{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2023-11-20T07:14:24.022256300Z",
     "start_time": "2023-11-20T07:14:24.001883400Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df_NH = pd.read_csv('../static/data/pretreatment_NH_data.csv')\n",
    "df_SHH = pd.read_csv('../static/data/pretreatment_SHH_data.csv')\n",
    "df_regression_line = pd.read_csv('../static/data/liner_Regression.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "outputs": [
    {
     "data": {
      "text/plain": "[[0, 0, 1],\n [1, 0, 0],\n [2, 0, 0],\n [3, 0, 1],\n [4, 0, 1],\n [5, 0, 0],\n [6, 0, 0],\n [7, 0, 0],\n [0, 1, 0],\n [1, 1, 0],\n [2, 1, 0],\n [3, 1, 0],\n [4, 1, 0],\n [5, 1, 0],\n [6, 1, 0],\n [7, 1, 0],\n [0, 2, 3],\n [1, 2, 1],\n [2, 2, 0],\n [3, 2, 0],\n [4, 2, 0],\n [5, 2, 0],\n [6, 2, 1],\n [7, 2, 0],\n [0, 3, 14],\n [1, 3, 1],\n [2, 3, 0],\n [3, 3, 13],\n [4, 3, 0],\n [5, 3, 0],\n [6, 3, 1],\n [7, 3, 2],\n [0, 4, 7],\n [1, 4, 2],\n [2, 4, 1],\n [3, 4, 12],\n [4, 4, 4],\n [5, 4, 1],\n [6, 4, 9],\n [7, 4, 2],\n [0, 5, 26],\n [1, 5, 4],\n [2, 5, 6],\n [3, 5, 25],\n [4, 5, 2],\n [5, 5, 2],\n [6, 5, 3],\n [7, 5, 6],\n [0, 6, 6],\n [1, 6, 0],\n [2, 6, 5],\n [3, 6, 20],\n [4, 6, 1],\n [5, 6, 0],\n [6, 6, 0],\n [7, 6, 0],\n [0, 7, 2],\n [1, 7, 0],\n [2, 7, 3],\n [3, 7, 13],\n [4, 7, 0],\n [5, 7, 0],\n [6, 7, 0],\n [7, 7, 0],\n [0, 8, 0],\n [1, 8, 0],\n [2, 8, 2],\n [3, 8, 7],\n [4, 8, 0],\n [5, 8, 0],\n [6, 8, 0],\n [7, 8, 0],\n [0, 9, 1],\n [1, 9, 0],\n [2, 9, 2],\n [3, 9, 6],\n [4, 9, 0],\n [5, 9, 0],\n [6, 9, 0],\n [7, 9, 0],\n [0, 10, 0],\n [1, 10, 0],\n [2, 10, 0],\n [3, 10, 3],\n [4, 10, 0],\n [5, 10, 0],\n [6, 10, 0],\n [7, 10, 0],\n [0, 11, 0],\n [1, 11, 0],\n [2, 11, 0],\n [3, 11, 1],\n [4, 11, 0],\n [5, 11, 0],\n [6, 11, 0],\n [7, 11, 0],\n [0, 12, 0],\n [1, 12, 0],\n [2, 12, 0],\n [3, 12, 0],\n [4, 12, 0],\n [5, 12, 0],\n [6, 12, 0],\n [7, 12, 0],\n [0, 13, 0],\n [1, 13, 0],\n [2, 13, 0],\n [3, 13, 1],\n [4, 13, 0],\n [5, 13, 0],\n [6, 13, 0],\n [7, 13, 0],\n [0, 14, 0],\n [1, 14, 0],\n [2, 14, 0],\n [3, 14, 0],\n [4, 14, 0],\n [5, 14, 0],\n [6, 14, 0],\n [7, 14, 0],\n [0, 15, 0],\n [1, 15, 0],\n [2, 15, 0],\n [3, 15, 1],\n [4, 15, 0],\n [5, 15, 0],\n [6, 15, 0],\n [7, 15, 0],\n [0, 16, 0],\n [1, 16, 0],\n [2, 16, 0],\n [3, 16, 0],\n [4, 16, 0],\n [5, 16, 0],\n [6, 16, 0],\n [7, 16, 0],\n [0, 17, 0],\n [1, 17, 0],\n [2, 17, 0],\n [3, 17, 1],\n [4, 17, 0],\n [5, 17, 0],\n [6, 17, 0],\n [7, 17, 0],\n [0, 18, 0],\n [1, 18, 0],\n [2, 18, 0],\n [3, 18, 0],\n [4, 18, 0],\n [5, 18, 0],\n [6, 18, 0],\n [7, 18, 0],\n [0, 19, 1],\n [1, 19, 0],\n [2, 19, 0],\n [3, 19, 0],\n [4, 19, 0],\n [5, 19, 0],\n [6, 19, 0],\n [7, 19, 0]]"
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "range_list = []\n",
    "for num in range(1, 21):\n",
    "    range_list.append(df_NH[['region', 'unit_price']].groupby(['region']).apply(\n",
    "        lambda x: x[(x[\"unit_price\"] <= 1000 * num) & (1000 * (num - 1) < x[\"unit_price\"])].count())[\n",
    "                          'unit_price'].rename('{}k-{}k'.format(num, num - 1)))\n",
    "df = pd.DataFrame(range_list)\n",
    "data = [[i,j,int(df.iloc[j,i])] for j in range(len(df.index)) for i in range(len(df.columns))]\n",
    "data"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-20T07:41:40.128897600Z",
     "start_time": "2023-11-20T07:41:39.932480500Z"
    }
   },
   "id": "65f9e9ee287b9247"
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "outputs": [
    {
     "data": {
      "text/plain": "region       东源  和平  江东  源城  紫金  连平  高新  龙川\n1000-0        1   0   0   1   1   0   0   0\n2000-1000     0   0   0   0   0   0   0   0\n3000-2000     3   1   0   0   0   0   1   0\n4000-3000    14   1   0  13   0   0   1   2\n5000-4000     7   2   1  12   4   1   9   2\n6000-5000    26   4   6  25   2   2   3   6\n7000-6000     6   0   5  20   1   0   0   0\n8000-7000     2   0   3  13   0   0   0   0\n9000-8000     0   0   2   7   0   0   0   0\n10000-9000    1   0   2   6   0   0   0   0\n11000-10000   0   0   0   3   0   0   0   0\n12000-11000   0   0   0   1   0   0   0   0\n13000-12000   0   0   0   0   0   0   0   0\n14000-13000   0   0   0   1   0   0   0   0\n15000-14000   0   0   0   0   0   0   0   0\n16000-15000   0   0   0   1   0   0   0   0\n17000-16000   0   0   0   0   0   0   0   0\n18000-17000   0   0   0   1   0   0   0   0\n19000-18000   0   0   0   0   0   0   0   0\n20000-19000   1   0   0   0   0   0   0   0",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th>region</th>\n      <th>东源</th>\n      <th>和平</th>\n      <th>江东</th>\n      <th>源城</th>\n      <th>紫金</th>\n      <th>连平</th>\n      <th>高新</th>\n      <th>龙川</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1000-0</th>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2000-1000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>3000-2000</th>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4000-3000</th>\n      <td>14</td>\n      <td>1</td>\n      <td>0</td>\n      <td>13</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>5000-4000</th>\n      <td>7</td>\n      <td>2</td>\n      <td>1</td>\n      <td>12</td>\n      <td>4</td>\n      <td>1</td>\n      <td>9</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>6000-5000</th>\n      <td>26</td>\n      <td>4</td>\n      <td>6</td>\n      <td>25</td>\n      <td>2</td>\n      <td>2</td>\n      <td>3</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>7000-6000</th>\n      <td>6</td>\n      <td>0</td>\n      <td>5</td>\n      <td>20</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>8000-7000</th>\n      <td>2</td>\n      <td>0</td>\n      <td>3</td>\n      <td>13</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>9000-8000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>2</td>\n      <td>7</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>10000-9000</th>\n      <td>1</td>\n      <td>0</td>\n      <td>2</td>\n      <td>6</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>11000-10000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>3</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>12000-11000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>13000-12000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>14000-13000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>15000-14000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>16000-15000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>17000-16000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>18000-17000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>19000-18000</th>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>20000-19000</th>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-20T07:24:14.664956500Z",
     "start_time": "2023-11-20T07:24:14.654441700Z"
    }
   },
   "id": "decd860a180f1793"
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "outputs": [
    {
     "data": {
      "text/plain": "[{'value': 552.0, 'name': '东源'},\n {'value': 157.0, 'name': '和平'},\n {'value': 19.0, 'name': '江东'},\n {'value': 2153.0, 'name': '源城'},\n {'value': 118.0, 'name': '紫金'},\n {'value': 4.0, 'name': '连平'},\n {'value': 143.0, 'name': '高新'},\n {'value': 106.0, 'name': '龙川'}]"
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pie_data = [{'value': df_NH.count().values.tolist()[0],'name':'新房'},{'value':df_SHH.count().values.tolist()[0],'name':'二手房'}]\n",
    "df_NH_annular = df_NH[['region','name']].groupby(['region']).count()\n",
    "df_SHH_annular= df_SHH[['region','name']].groupby(['region']).count()\n",
    "annular_data = df_SHH_annular.add(df_NH_annular,fill_value=0).reset_index().values.tolist()\n",
    "annular_data = [{'value':i[1],'name':i[0]} for i in annular_data]\n",
    "annular_data"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-20T05:59:27.942305200Z",
     "start_time": "2023-11-20T05:59:27.917908800Z"
    }
   },
   "id": "18c5efc8c624b10f"
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "outputs": [
    {
     "data": {
      "text/plain": "  region    name\n0     东源   552.0\n1     和平   157.0\n2     江东    19.0\n3     源城  2153.0\n4     紫金   118.0\n5     连平     4.0\n6     高新   143.0\n7     龙川   106.0",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>region</th>\n      <th>name</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>东源</td>\n      <td>552.0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>和平</td>\n      <td>157.0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>江东</td>\n      <td>19.0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>源城</td>\n      <td>2153.0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>紫金</td>\n      <td>118.0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>连平</td>\n      <td>4.0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>高新</td>\n      <td>143.0</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>龙川</td>\n      <td>106.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-20T05:59:13.783184900Z",
     "start_time": "2023-11-20T05:59:12.925849100Z"
    }
   },
   "id": "e81fe84bdeebed81"
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'name': '东源县', 'data': [1, 0, 35, 25]},\n  {'name': '和平县', 'data': [0, 0, 4, 4]},\n  {'name': '江东新区', 'data': [0, 0, 18, 1]},\n  {'name': '源城区', 'data': [2, 5, 71, 26]},\n  {'name': '紫金县', 'data': [0, 0, 3, 5]},\n  {'name': '连平', 'data': [0, 0, 2, 1]},\n  {'name': '高新区', 'data': [0, 0, 3, 11]},\n  {'name': '龙川县', 'data': [0, 0, 6, 4]}],\n 'name': ['20000-15000', '15000-10000', '10000-5000', '5000-0']}"
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "first = df_NH[['region', 'unit_price']].groupby(['region']).apply(\n",
    "    lambda x: x[(x[\"unit_price\"] <= 20000) & (15000 < x[\"unit_price\"])].count())['unit_price'].rename('20000-15000')\n",
    "second = df_NH[['region', 'unit_price']].groupby(['region']).apply(\n",
    "    lambda x: x[(x[\"unit_price\"] <= 15000) & (10000 < x[\"unit_price\"])].count())['unit_price'].rename('15000-10000')\n",
    "third = df_NH[['region', 'unit_price']].groupby(['region']).apply(\n",
    "    lambda x: x[(x[\"unit_price\"] <= 10000) & (5000 < x[\"unit_price\"])].count())['unit_price'].rename('10000-5000')\n",
    "fourth = df_NH[['region', 'unit_price']].groupby(['region']).apply(\n",
    "    lambda x: x[(x[\"unit_price\"] <= 5000) & (0 < x[\"unit_price\"])].count())['unit_price'].rename('5000-0')\n",
    "df = pd.concat([first,second,third,fourth],axis=1)\n",
    "df = df.transpose()\n",
    "data = {\n",
    "    'data':[{'name':i,'data':df[i].tolist()} for i in df],\n",
    "    'name':df.index.tolist()\n",
    "}\n",
    "data"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-18T08:13:15.706302100Z",
     "start_time": "2023-11-18T08:13:15.650339200Z"
    }
   },
   "id": "e9f6b20f5bb7c7c1"
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'name': '东源县', 'data': [1, 17, 33, 8, 1, 0, 0, 0, 0, 1]},\n  {'name': '和平县', 'data': [0, 2, 6, 0, 0, 0, 0, 0, 0, 0]},\n  {'name': '江东新区', 'data': [0, 0, 7, 8, 4, 0, 0, 0, 0, 0]},\n  {'name': '源城区', 'data': [1, 13, 37, 33, 13, 4, 1, 1, 1, 0]},\n  {'name': '紫金县', 'data': [1, 0, 6, 1, 0, 0, 0, 0, 0, 0]},\n  {'name': '连平', 'data': [0, 0, 3, 0, 0, 0, 0, 0, 0, 0]},\n  {'name': '高新区', 'data': [0, 2, 12, 0, 0, 0, 0, 0, 0, 0]},\n  {'name': '龙川县', 'data': [0, 2, 8, 0, 0, 0, 0, 0, 0, 0]}],\n 'name': ['2000-0',\n  '4000-2000',\n  '6000-4000',\n  '8000-6000',\n  '10000-8000',\n  '12000-10000',\n  '14000-12000',\n  '16000-14000',\n  '18000-16000',\n  '20000-18000']}"
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rangeList = []\n",
    "for num in range(1,11):\n",
    "    rangeList.append(df_NH[['region', 'unit_price']].groupby(['region']).apply(\n",
    "    lambda x: x[(x[\"unit_price\"] <= 2000*num) & (2000*(num-1) < x[\"unit_price\"])].count())['unit_price'].rename('{}-{}'.format(2000*num,2000*(num-1))))\n",
    "df = pd.concat(rangeList,axis=1)\n",
    "df = df.transpose()\n",
    "data = {\n",
    "    'data':[{'name':i,'data':df[i].tolist()} for i in df],\n",
    "    'name':df.index.tolist()\n",
    "}\n",
    "data"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-18T08:33:55.945676800Z",
     "start_time": "2023-11-18T08:33:55.858057900Z"
    }
   },
   "id": "5bb340b5439d2f3c"
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "outputs": [
    {
     "data": {
      "text/plain": "[{'name': '一通国际汽车城', 'category': 0},\n {'name': '一通麓湖国际', 'category': 0},\n {'name': '万家和商住楼', 'category': 0},\n {'name': '万绿春天', 'category': 0},\n {'name': '万绿桃源', 'category': 0},\n {'name': '万绿湖·保利生态城', 'category': 0},\n {'name': '万绿湖国际公馆公寓', 'category': 0},\n {'name': '万隆·钓鱼台一号', 'category': 0},\n {'name': '万隆丽景', 'category': 0},\n {'name': '万隆城', 'category': 0},\n {'name': '万隆都市100', 'category': 0},\n {'name': '三友南城', 'category': 0},\n {'name': '三友轩', 'category': 0},\n {'name': '上和府', 'category': 0},\n {'name': '东发佳园', 'category': 0},\n {'name': '东城豪庭', 'category': 0},\n {'name': '东新翡翠珑悦', 'category': 0},\n {'name': '东方尊御', 'category': 0},\n {'name': '东江御城', 'category': 0},\n {'name': '东江桃源', 'category': 0},\n {'name': '东江湾', 'category': 0},\n {'name': '东江湾1号', 'category': 0},\n {'name': '东江源国际温泉旅游度假区', 'category': 0},\n {'name': '东江首府', 'category': 0},\n {'name': '东湖花园', 'category': 0},\n {'name': '东福花园', 'category': 0},\n {'name': '中兴体育新城', 'category': 0},\n {'name': '中心华府', 'category': 0},\n {'name': '中心壹号教育城', 'category': 0},\n {'name': '中昂祥云府', 'category': 0},\n {'name': '中泰·金泽苑', 'category': 0},\n {'name': '丽日中心城', 'category': 0},\n {'name': '丽格雅苑', 'category': 0},\n {'name': '亿和城市广场', 'category': 0},\n {'name': '仙塘中心市场创富中央', 'category': 0},\n {'name': '佳悦·名仕华府', 'category': 0},\n {'name': '佳悦・名仕华府', 'category': 0},\n {'name': '保利188阅江台', 'category': 0},\n {'name': '兴业城', 'category': 0},\n {'name': '兴泰花园三期', 'category': 0},\n {'name': '兴泰雅苑', 'category': 0},\n {'name': '凯旋国际', 'category': 0},\n {'name': '十里东岸·江语城', 'category': 0},\n {'name': '升恒华府', 'category': 0},\n {'name': '华丰国贸金湾', 'category': 0},\n {'name': '华侨城', 'category': 0},\n {'name': '华南城十里东岸四期·绿卡', 'category': 0},\n {'name': '华城国际', 'category': 0},\n {'name': '华城钻石', 'category': 0},\n {'name': '华泰花园', 'category': 0},\n {'name': '华达·财富港', 'category': 0},\n {'name': '华达国际', 'category': 0},\n {'name': '华达新城', 'category': 0},\n {'name': '华达新城商铺', 'category': 0},\n {'name': '华达新城融悦', 'category': 0},\n {'name': '华达新苑', 'category': 0},\n {'name': '华锋国际汽配城', 'category': 0},\n {'name': '南城国际', 'category': 0},\n {'name': '南门居', 'category': 0},\n {'name': '友诚丽苑', 'category': 0},\n {'name': '友诚公园国际', 'category': 0},\n {'name': '君临华府', 'category': 0},\n {'name': '君临时代', 'category': 0},\n {'name': '和平印象新天地', 'category': 0},\n {'name': '和平碧桂园', 'category': 0},\n {'name': '和平碧桂园·星钻', 'category': 0},\n {'name': '商汇大厦', 'category': 0},\n {'name': '嘉和居', 'category': 0},\n {'name': '嘉多麗花园', 'category': 0},\n {'name': '嘉福花园', 'category': 0},\n {'name': '坚基·沁园和府', 'category': 0},\n {'name': '坚基·美好嘉园', 'category': 0},\n {'name': '坚基春天里', 'category': 0},\n {'name': '坚基风光里', 'category': 0},\n {'name': '天和城', 'category': 0},\n {'name': '威尼斯湾', 'category': 0},\n {'name': '宁联天和城', 'category': 0},\n {'name': '宝晟城', 'category': 0},\n {'name': '宝莱家园', 'category': 0},\n {'name': '宝豪印象', 'category': 0},\n {'name': '宝豪御龙湾上品', 'category': 0},\n {'name': '客天下河源', 'category': 0},\n {'name': '家和·水岸沁园', 'category': 0},\n {'name': '家福建材批发广场', 'category': 0},\n {'name': '富力天禧花园', 'category': 0},\n {'name': '山湖海·悦府', 'category': 0},\n {'name': '巴伐利亚庄园', 'category': 0},\n {'name': '帝豪国际花园', 'category': 0},\n {'name': '康德名都', 'category': 0},\n {'name': '康柏丽景园', 'category': 0},\n {'name': '建顺上林苑', 'category': 0},\n {'name': '御城国际', 'category': 0},\n {'name': '御江帝景湾', 'category': 0},\n {'name': '德润华府', 'category': 0},\n {'name': '怡景福田', 'category': 0},\n {'name': '怡景茗都', 'category': 0},\n {'name': '恒和·尚悦湾', 'category': 0},\n {'name': '恒大名都', 'category': 0},\n {'name': '恒宝·星河湾', 'category': 0},\n {'name': '振业江岸', 'category': 0},\n {'name': '振业深河湾', 'category': 0},\n {'name': '敏捷悦江府', 'category': 0},\n {'name': '新城豪庭', 'category': 0},\n {'name': '新域蓝山', 'category': 0},\n {'name': '新景·阳光广场', 'category': 0},\n {'name': '新河·御湖国际', 'category': 0},\n {'name': '新河中央', 'category': 0},\n {'name': '新河花园', 'category': 0},\n {'name': '新源雅园', 'category': 0},\n {'name': '方圆·河源月岛首府', 'category': 0},\n {'name': '时代倾城', 'category': 0},\n {'name': '明源新天地', 'category': 0},\n {'name': '明珠华庭', 'category': 0},\n {'name': '星光源江豪庭', 'category': 0},\n {'name': '星河国际', 'category': 0},\n {'name': '桃源国际', 'category': 0},\n {'name': '汇景·九里湾花园', 'category': 0},\n {'name': '汇景外滩8号', 'category': 0},\n {'name': '汇景御府中央', 'category': 0},\n {'name': '江南居', 'category': 0},\n {'name': '江城华府', 'category': 0},\n {'name': '江山一品', 'category': 0},\n {'name': '江景湾', 'category': 0},\n {'name': '江泮花城', 'category': 0},\n {'name': '河源万达CBD', 'category': 0},\n {'name': '河源万达东江城', 'category': 0},\n {'name': '河源万达广场', 'category': 0},\n {'name': '河源中梁首府', 'category': 0},\n {'name': '河源中骏世界城', 'category': 0},\n {'name': '河源古镇灯饰博览中心SOHO公馆', 'category': 0},\n {'name': '河源客天下国际旅游度假区', 'category': 0},\n {'name': '河源市商业中心|坚基·美丽城', 'category': 0},\n {'name': '河源恒大滨江左岸', 'category': 0},\n {'name': '河源恒大锦苑', 'category': 0},\n {'name': '河源敏捷珑山源著', 'category': 0},\n {'name': '河源星河丹堤', 'category': 0},\n {'name': '河源森林湖', 'category': 0},\n {'name': '河源美的云筑', 'category': 0},\n {'name': '河源美的城', 'category': 0},\n {'name': '河源长胜国际', 'category': 0},\n {'name': '河源雅居乐明珠城', 'category': 0},\n {'name': '河源雅居乐源著', 'category': 0},\n {'name': '泰和·中央公园', 'category': 0},\n {'name': '泰和学苑', 'category': 0},\n {'name': '泰和龙岸', 'category': 0},\n {'name': '洲邦·大悦城', 'category': 0},\n {'name': '浩创花语城', 'category': 0},\n {'name': '润丰天虹花园', 'category': 0},\n {'name': '深业塞纳湾', 'category': 0},\n {'name': '港晟豪庭', 'category': 0},\n {'name': '百信梧桐嘉园', 'category': 0},\n {'name': '百盛时代', 'category': 0},\n {'name': '益和花园', 'category': 0},\n {'name': '碧桂园·东江凤凰城', 'category': 0},\n {'name': '碧桂园·公园上城', 'category': 0},\n {'name': '碧桂园·未来城', 'category': 0},\n {'name': '碧桂园东江凤凰城凤凰湾', 'category': 0},\n {'name': '碧桂园凤凰上城', 'category': 0},\n {'name': '碧桂园凤凰名筑', 'category': 0},\n {'name': '碧桂园凤凰山', 'category': 0},\n {'name': '立元·世纪年华', 'category': 0},\n {'name': '紫金·荣耀城', 'category': 0},\n {'name': '紫金江湾明珠', 'category': 0},\n {'name': '紫金碧桂园', 'category': 0},\n {'name': '紫金碧桂园翠湖湾', 'category': 0},\n {'name': '繁盛观澜府', 'category': 0},\n {'name': '纯水岸', 'category': 0},\n {'name': '维景南城花园', 'category': 0},\n {'name': '绿意春风十里', 'category': 0},\n {'name': '美丽华', 'category': 0},\n {'name': '美林湖', 'category': 0},\n {'name': '翔龙国际', 'category': 0},\n {'name': '翠泽雍园', 'category': 0},\n {'name': '育茗.龙福家园', 'category': 0},\n {'name': '胜业苑', 'category': 0},\n {'name': '胜业豪庭', 'category': 0},\n {'name': '西环壹号院', 'category': 0},\n {'name': '誉东方', 'category': 0},\n {'name': '誉东方商铺', 'category': 0},\n {'name': '运恒皇冠花园', 'category': 0},\n {'name': '连平碧桂园', 'category': 0},\n {'name': '逸香花园', 'category': 0},\n {'name': '金美家名都', 'category': 0},\n {'name': '金茂·家时代', 'category': 0},\n {'name': '鑫苑·温馨家园', 'category': 0},\n {'name': '铭成·华瑞美苑', 'category': 0},\n {'name': '铭成华府', 'category': 0},\n {'name': '铭成花园', 'category': 0},\n {'name': '铭成锦上花', 'category': 0},\n {'name': '锦云颐和花园', 'category': 0},\n {'name': '锦绣桃源', 'category': 0},\n {'name': '长鸿·龙宸桦府', 'category': 0},\n {'name': '长鸿金融中心', 'category': 0},\n {'name': '阳光名居', 'category': 0},\n {'name': '阳光水岸', 'category': 0},\n {'name': '阳光波尔登', 'category': 0},\n {'name': '阳光美居', 'category': 0},\n {'name': '雅居乐·悦江', 'category': 0},\n {'name': '雅居乐御宾府', 'category': 0},\n {'name': '雅居乐花园', 'category': 0},\n {'name': '雅居乐金麟府', 'category': 0},\n {'name': '雍和园', 'category': 0},\n {'name': '霸王花·丽江花园', 'category': 0},\n {'name': '霸王花·君临苑', 'category': 0},\n {'name': '霸王花·月亮湾', 'category': 0},\n {'name': '霸王花东城国际', 'category': 0},\n {'name': '霸王花新城', 'category': 0},\n {'name': '顺和新苑', 'category': 0},\n {'name': '高升苑', 'category': 0},\n {'name': '鸿润华府', 'category': 0},\n {'name': '鸿福城市丽苑', 'category': 0},\n {'name': '鸿运源.绿海名居', 'category': 0},\n {'name': '龙光城', 'category': 0},\n {'name': '龙光玖云臺', 'category': 0},\n {'name': '龙光玖誉湖', 'category': 0},\n {'name': '龙光玖龙府', 'category': 0},\n {'name': '1室', 'category': 1},\n {'name': '2室', 'category': 1},\n {'name': '3室', 'category': 1},\n {'name': '4室', 'category': 1},\n {'name': '5室', 'category': 1},\n {'name': '6室', 'category': 1},\n {'name': '别墅', 'category': 1},\n {'name': '商住', 'category': 1},\n {'name': '无', 'category': 1}]"
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_graph = df_NH.drop('house_type', axis=1).join(\n",
    "        df_NH['house_type'].str.split(',', expand=True).stack().reset_index(level=1, drop=True).rename('house_type'))\n",
    "df_edges = df_graph[['house_type','name']].groupby(['house_type','name']).count().index.tolist()\n",
    "edges = [{'source':i[1],'target':i[0]}for i in df_edges]\n",
    "df_data_type = df_graph[['house_type']].groupby(['house_type']).count().index.tolist()\n",
    "data_type = [{'name':i,'category':1}for i in df_data_type]\n",
    "df_data_house = df_graph[['name']].groupby(['name']).count().index.tolist()\n",
    "data_house = [{'name':i,'category':0}for i in df_data_house]\n",
    "data_house.extend(data_type)\n",
    "data_house"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-19T01:49:17.263610800Z",
     "start_time": "2023-11-19T01:49:17.232964600Z"
    }
   },
   "id": "1fefb3ff699462b1"
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "outputs": [
    {
     "data": {
      "text/plain": "[[5660, 88.0],\n [8120, 117.0],\n [5689, 135.0],\n [4293, 130.0],\n [4528, 110.0],\n [5391, 128.0],\n [5642, 106.0],\n [5932, 145.0],\n [5152, 99.0],\n [5248, 93.0],\n [5932, 145.0],\n [5616, 130.0],\n [5622, 112.07],\n [6030, 136.0],\n [3889, 90.0],\n [6459, 48.0],\n [6496, 109.0],\n [4069, 147.0],\n [3847, 143.0],\n [5310, 113.0],\n [2895, 114.0],\n [5084, 96.0],\n [6492, 57.0],\n [5300, 100.0],\n [4738, 103.0],\n [6644, 143.0],\n [2484, 120.0],\n [5076, 106.0],\n [7689, 122.0],\n [5150, 167.0],\n [3750, 120.0],\n [2000, 80.0],\n [4131, 92.0],\n [4743, 105.0],\n [10394, 178.0],\n [8530, 170.0],\n [5486, 140.0],\n [3821, 78.0],\n [6898, 107.0],\n [3300, 60.0],\n [5790, 108.81],\n [3346, 110.0],\n [6585, 106.0],\n [2167, 120.0],\n [4873, 55.0],\n [5437, 110.0],\n [4643, 168.0],\n [5354, 112.07],\n [2829, 70.0],\n [3590, 156.0],\n [4190, 95.0],\n [8056, 108.0],\n [3392, 138.0],\n [5075, 117.85],\n [3176, 97.0],\n [5269, 94.91],\n [5000, 120.0],\n [9020, 155.0],\n [5000, 120.0],\n [3209, 96.0],\n [4753, 113.2],\n [4804, 112.0],\n [5969, 127.0],\n [8348, 115.0],\n [4690, 145.0],\n [4408, 113.0],\n [5642, 106.0],\n [5908, 130.0],\n [5269, 94.91],\n [9020, 155.0],\n [5000, 120.0],\n [4753, 113.2],\n [3209, 96.0],\n [8348, 115.0],\n [4690, 145.0],\n [4804, 112.0],\n [5969, 127.0],\n [5642, 106.0],\n [5908, 130.0],\n [7744, 125.0],\n [5141, 107.0],\n [6079, 128.0],\n [6250, 120.0],\n [7786, 124.34],\n [5675, 123.0],\n [5806, 101.63],\n [4580, 107.0],\n [5068, 118.0],\n [6593, 135.0],\n [6223, 135.0],\n [5697, 112.0],\n [5615, 135.0],\n [5791, 86.0],\n [6771, 109.0],\n [7500, 140.0],\n [4319, 113.0],\n [6275, 124.0],\n [3441, 168.0],\n [5200, 115.0],\n [7500, 140.0],\n [4902, 153.0],\n [5764, 105.83],\n [6195, 103.0],\n [6077, 130.0],\n [3900, 120.0],\n [4351, 124.11],\n [7817, 120.0],\n [5675, 123.0],\n [5417, 96.0],\n [3689, 154.0],\n [6154, 104.0],\n [5600, 125.0],\n [6438, 122.4],\n [4694, 98.0],\n [5810, 130.82],\n [5579, 95.0],\n [6800, 125.0],\n [5834, 96.0],\n [4139, 130.0],\n [7053, 133.0],\n [3245, 172.0],\n [5529, 123.0],\n [7744, 125.0],\n [4347, 124.24],\n [5169, 89.0],\n [4800, 125.0],\n [6399, 118.0],\n [7960, 98.0],\n [5834, 96.0],\n [7769, 95.0],\n [7504, 133.0],\n [6560, 143.0],\n [7206, 136.0],\n [6545, 136.0],\n [6545, 136.0],\n [5392, 115.0],\n [9020, 155.0],\n [5000, 120.0],\n [3209, 96.0],\n [4753, 113.2],\n [4690, 145.0],\n [4804, 112.0],\n [8348, 115.0],\n [5969, 127.0],\n [5392, 115.0],\n [4407, 118.0],\n [7150, 120.0],\n [5762, 109.0],\n [7264, 110.0],\n [6241, 83.0],\n [6000, 130.0],\n [5069, 116.0],\n [6050, 162.0],\n [5463, 93.0],\n [5462, 130.0],\n [4894, 94.0],\n [5300, 100.0],\n [5284, 115.45],\n [6738, 141.0],\n [5355, 93.0],\n [5358, 112.0],\n [4425, 113.0],\n [5690, 116.0],\n [7959, 96.5],\n [7907, 129.0],\n [4648, 142.0],\n [5917, 96.0],\n [4351, 124.11],\n [5538, 108.0],\n [5567, 120.0],\n [5582, 129.0],\n [5048, 105.0],\n [6607, 145.0],\n [4170, 165.0],\n [6965, 112.0],\n [6328, 94.83],\n [7734, 120.0],\n [5533, 122.0],\n [4389, 175.0],\n [5660, 128.98],\n [4584, 120.0],\n [5231, 130.0],\n [5627, 117.31],\n [5581, 143.0],\n [6217, 148.0],\n [6463, 108.0],\n [3560, 168.0],\n [4959, 121.0],\n [5592, 93.0],\n [3813, 128.0],\n [5173, 116.0],\n [5044, 115.0],\n [5509, 114.0],\n [8051, 118.0],\n [6416, 106.0],\n [6073, 110.0],\n [5600, 130.0],\n [4255, 110.0],\n [6277, 159.0],\n [6647, 102.31],\n [5902, 122.0],\n [4462, 143.0],\n [5743, 132.0],\n [4814, 118.0],\n [7079, 141.0],\n [6617, 133.0],\n [6399, 118.0],\n [6403, 139.0],\n [6667, 129.0],\n [7295, 156.0],\n [7305, 141.0],\n [5861, 143.0],\n [7504, 145.0],\n [6965, 112.0],\n [7758, 99.0],\n [6369, 152.0],\n [6679, 143.0],\n [5665, 143.0],\n [6103, 136.0],\n [5592, 93.0],\n [6572, 91.0],\n [6438, 122.4],\n [5533, 137.0],\n [6622, 119.0],\n [5090, 112.0],\n [6031, 131.0],\n [7623, 127.0],\n [6292, 103.0],\n [6085, 118.0],\n [7029, 105.0],\n [5200, 115.0],\n [6713, 146.0],\n [6049, 165.0],\n [7040, 125.0],\n [5778, 135.0],\n [6277, 159.0],\n [7780, 145.0],\n [7194, 129.0],\n [7769, 95.0],\n [7014, 109.07],\n [5734, 120.0],\n [5474, 133.0],\n [7473, 91.0],\n [7760, 125.0],\n [6262, 95.5],\n [5932, 145.0],\n [5567, 120.0],\n [6880, 116.0],\n [5316, 118.15],\n [7734, 120.0],\n [5675, 123.0],\n [5538, 108.0],\n [7343, 143.0],\n [7355, 189.0],\n [6614, 189.0],\n [5979, 92.0],\n [5606, 137.0],\n [7425, 132.0],\n [6517, 122.0],\n [6139, 130.0],\n [6771, 109.0],\n [6680, 108.99],\n [6535, 101.0],\n [6476, 122.0],\n [6476, 122.0],\n [6139, 130.0],\n [6771, 109.0],\n [8143, 98.0],\n [6680, 108.99],\n [6535, 101.0],\n [7297, 108.0],\n [5515, 136.0],\n [5484, 120.0],\n [5734, 120.0],\n [6853, 115.0],\n [6544, 125.0],\n [6644, 143.0],\n [5159, 126.0],\n [9768, 129.0],\n [5529, 123.0],\n [8427, 122.0],\n [5284, 106.0],\n [8280, 100.0],\n [7485, 128.0],\n [6541, 122.0],\n [7266, 128.0],\n [6276, 116.0],\n [7764, 152.0],\n [4642, 159.0],\n [9020, 155.0],\n [9020, 155.0],\n [5769, 121.0],\n [5026, 117.0],\n [6250, 104.0],\n [6317, 120.0],\n [6031, 131.0],\n [6985, 126.0],\n [8245, 131.0],\n [6072, 112.0],\n [6034, 119.0],\n [7680, 100.0],\n [6034, 119.0],\n [8245, 131.0],\n [6768, 112.0],\n [5509, 114.0],\n [7047, 149.0],\n [6749, 139.0],\n [5589, 107.0],\n [6667, 132.0],\n [7561, 123.0],\n [5068, 118.0],\n [5323, 118.0],\n [5486, 140.0],\n [6556, 198.0],\n [5740, 92.0],\n [5759, 116.0],\n [5219, 128.0],\n [5979, 95.0],\n [5395, 109.0],\n [7194, 129.0],\n [5746, 118.0],\n [5358, 112.0],\n [5141, 107.0],\n [5917, 96.0],\n [5744, 125.0],\n [6184, 117.74],\n [5061, 164.0],\n [5675, 123.0],\n [7164, 177.0],\n [6050, 162.0],\n [5633, 147.0],\n [5518, 112.0],\n [5068, 118.0],\n [5536, 112.0],\n [5029, 107.0],\n [6230, 96.0],\n [6563, 96.0],\n [5276, 138.0],\n [5238, 122.0],\n [6648, 102.0],\n [5076, 106.0],\n [6117, 137.0],\n [6029, 139.0],\n [7311, 145.0],\n [7660, 141.0],\n [5437, 110.0],\n [5908, 108.0],\n [5029, 107.0],\n [6255, 102.0],\n [6416, 106.0],\n [5550, 151.0],\n [6490, 143.0],\n [7040, 125.0],\n [5353, 136.0],\n [7688, 96.0],\n [5699, 93.0],\n [5407, 118.0],\n [8866, 141.0],\n [5581, 143.0],\n [6070, 143.0],\n [6647, 102.31],\n [6332, 91.6],\n [6237, 93.0],\n [5465, 136.89],\n [8364, 99.0],\n [5171, 135.0],\n [5721, 136.0],\n [6143, 112.0],\n [5218, 138.0],\n [7758, 99.0],\n [6139, 130.0],\n [7047, 149.0],\n [7095, 117.0],\n [5487, 109.0],\n [5400, 120.0],\n [6848, 92.0],\n [5417, 120.0],\n [7817, 120.0],\n [5411, 129.0],\n [5260, 108.0],\n [5763, 135.0],\n [4625, 112.0],\n [5417, 120.0],\n [5417, 120.0],\n [5417, 120.0],\n [7817, 120.0],\n [5411, 129.0],\n [5260, 108.0],\n [6463, 108.0],\n [5360, 125.0],\n [5381, 126.0],\n [5238, 139.0],\n [5340, 112.0],\n [5053, 120.34],\n [5359, 106.0],\n [5721, 136.0],\n [7679, 143.0],\n [6159, 177.0],\n [7138, 102.0],\n [5029, 107.0],\n [7242, 124.0],\n [5759, 116.0],\n [5164, 141.0],\n [7480, 123.0],\n [5404, 124.0],\n [7421, 145.0],\n [6856, 159.0],\n [7659, 193.0],\n [5200, 115.0],\n [6208, 135.0],\n [6250, 120.0],\n [8038, 108.0],\n [5972, 107.0],\n [6105, 96.0],\n [7322, 109.0],\n [6092, 131.0],\n [5475, 137.0],\n [6016, 131.0],\n [6031, 131.0],\n [5979, 95.0],\n [7223, 108.0],\n [5182, 154.0],\n [7139, 137.0],\n [7308, 127.0],\n [6227, 106.0],\n [5272, 140.0],\n [6150, 120.0],\n [6195, 103.0],\n [5093, 108.0],\n [8263, 145.0],\n [5969, 127.0],\n [6031, 131.0],\n [5604, 116.0],\n [7481, 131.0],\n [6624, 125.0],\n [7942, 171.0],\n [7984, 125.0],\n [7340, 109.0],\n [5983, 117.0],\n [6217, 148.0],\n [5141, 107.0],\n [5715, 154.0],\n [6463, 108.0],\n [5959, 120.0],\n [5600, 200.0],\n [5946, 148.0],\n [5072, 112.0],\n [6489, 131.0],\n [5110, 119.0],\n [5463, 108.0],\n [7296, 122.0],\n [6056, 180.0],\n [6463, 108.0],\n [6137, 117.0],\n [5912, 113.0],\n [6148, 122.0],\n [5538, 108.0],\n [7907, 129.0],\n [7322, 109.0],\n [7565, 124.0],\n [4984, 120.0],\n [5809, 115.0],\n [5286, 98.0],\n [7677, 99.0],\n [7311, 145.0],\n [5672, 134.0],\n [7413, 107.65],\n [5766, 128.0],\n [5690, 116.0],\n [6646, 96.0],\n [5867, 118.99],\n [6882, 130.5],\n [5667, 90.0],\n [5735, 113.0],\n [5697, 112.0],\n [5369, 103.0],\n [5141, 107.0],\n [8368, 147.0],\n [8051, 118.0],\n [6179, 123.0],\n [5353, 136.0],\n [5355, 93.0],\n [6234, 150.0],\n [6771, 109.0],\n [6704, 125.0],\n [6436, 101.0],\n [7046, 109.0],\n [5353, 136.0],\n [5577, 118.0],\n [6075, 107.0],\n [5156, 116.0],\n [5610, 128.0],\n [6926, 108.0],\n [4984, 118.0],\n [8099, 142.0],\n [5176, 131.0],\n [6286, 140.0],\n [9545, 155.06],\n [8058, 139.0],\n [7000, 114.0],\n [7422, 159.0],\n [5660, 141.0],\n [5721, 129.0],\n [5340, 112.0],\n [5721, 129.0],\n [5150, 167.0],\n [6000, 130.0],\n [5624, 101.0],\n [7479, 122.75],\n [7305, 141.0],\n [6970, 198.0],\n [7181, 188.0],\n [5026, 117.0],\n [5640, 136.18],\n [4897, 116.0],\n [7700, 100.0],\n [5722, 115.0],\n [6838, 203.0],\n [7268, 162.36],\n [6077, 130.0],\n [5375, 160.0],\n [4888, 133.0],\n [6070, 143.0],\n [6075, 107.0],\n [5372, 156.0],\n [5029, 173.0],\n [6312, 122.0],\n [5902, 115.23],\n [5740, 92.0],\n [6477, 105.0],\n [5865, 133.0],\n [6000, 103.0],\n [4671, 158.0],\n [5359, 162.0],\n [6619, 110.0],\n [5734, 120.0],\n [6863, 142.8],\n [5660, 88.0],\n [7877, 146.0],\n [6229, 114.0],\n [5044, 115.0],\n [5112, 90.0],\n [5642, 106.0],\n [4655, 165.0],\n [7837, 98.0],\n [5059, 136.0],\n [5308, 130.0],\n [6073, 110.0],\n [7904, 415.0],\n [5203, 138.0],\n [6714, 119.01],\n [5293, 113.0],\n [8370, 130.0],\n [8182, 165.0],\n [5368, 136.0],\n [5618, 89.0],\n [5029, 107.0],\n [4528, 110.0],\n [4770, 130.0],\n [6730, 74.0],\n [6590, 129.0],\n [7747, 142.0],\n [6250, 104.0],\n [7038, 189.0],\n [5949, 77.0],\n [7112, 108.0],\n [5358, 140.0],\n [6275, 124.0],\n [5243, 95.0],\n [6165, 97.0],\n [5979, 92.0],\n [5339, 142.0],\n [8143, 98.0],\n [7414, 116.0],\n [4958, 117.0],\n [5076, 106.0],\n [8193, 177.0],\n [6602, 103.0],\n [5184, 98.0],\n [4379, 164.0],\n [5486, 140.0],\n [6323, 93.0],\n [7869, 198.0],\n [6878, 180.0],\n [4800, 125.0],\n [6838, 203.0],\n [5675, 123.0],\n [5690, 116.0],\n [7899, 157.0],\n [6416, 106.0],\n [7219, 143.79],\n [6819, 198.0],\n [7061, 198.0],\n [5293, 113.0],\n [5741, 108.0],\n [5767, 154.0],\n [7739, 168.0],\n [4408, 113.0],\n [6866, 141.0],\n [6572, 147.0],\n [6985, 126.0],\n [7261, 146.0],\n [6274, 212.0],\n [5986, 140.0],\n [5260, 108.0],\n [5164, 306.0],\n [4342, 170.0],\n [6416, 106.0],\n [6000, 98.0],\n [5908, 130.0],\n [8971, 136.0],\n [4569, 109.0],\n [4941, 168.0],\n [4870, 115.0],\n [7767, 206.0],\n [6250, 104.0],\n [5581, 143.0],\n [5164, 110.0],\n [5577, 118.0],\n [7112, 108.0],\n [6274, 212.0],\n [8971, 136.0],\n [6250, 104.0],\n [6250, 104.0],\n [4870, 115.0],\n [7767, 206.0],\n [6250, 104.0],\n [5164, 110.0],\n [5577, 118.0],\n [5721, 136.0],\n [5924, 130.0],\n [4980, 100.0],\n [5469, 128.0],\n [5260, 108.0],\n [4309, 162.0],\n [6159, 63.0],\n [5556, 45.0],\n [6838, 203.0],\n [8051, 118.0],\n [5636, 129.18],\n [5273, 121.0],\n [5339, 118.0],\n [8713, 132.0],\n [4672, 143.0],\n [7634, 131.0],\n [5200, 115.0],\n [4442, 157.16],\n [5116, 113.0],\n [10899, 89.0],\n [4445, 162.0],\n [5259, 89.0],\n [5791, 86.0],\n [5762, 109.0],\n [7436, 117.0],\n [4575, 94.0],\n [6295, 95.0],\n [6539, 104.0],\n [5978, 87.0],\n [6054, 112.0],\n [5930, 199.0],\n [6062, 97.0],\n [5753, 113.0],\n [5052, 120.35],\n [4546, 99.0],\n [4425, 99.0],\n [6811, 185.0],\n [5137, 95.0],\n [5735, 113.0],\n [6130, 110.94],\n [5271, 85.0],\n [5340, 112.0],\n [7596, 163.0],\n [4853, 136.0],\n [8410, 176.0],\n [6158, 76.0],\n [5213, 94.0],\n [4750, 128.0],\n [5179, 112.0],\n [5642, 106.0],\n [5785, 102.0],\n [4208, 135.0],\n [9236, 157.0],\n [5173, 133.0],\n [7268, 162.36],\n [6274, 212.0],\n [6137, 176.0],\n [4777, 121.0],\n [4728, 165.0],\n [5432, 116.0],\n [5475, 80.0],\n [4662, 118.0],\n [4752, 144.8],\n [7959, 96.5],\n [5135, 134.0],\n [5184, 98.0],\n [9549, 155.0],\n [4635, 123.0],\n [5073, 138.0],\n [5473, 91.0],\n [4447, 112.0],\n [7847, 144.02],\n [5120, 150.0],\n [6730, 74.0],\n [9007, 140.79],\n [6264, 95.0],\n [8276, 130.5],\n [5437, 110.0],\n [4737, 95.0],\n [5791, 86.0],\n [3664, 116.0],\n [5487, 109.0],\n [5410, 105.0],\n [8308, 130.0],\n [8588, 177.0],\n [8509, 122.0],\n [4874, 119.0],\n [6485, 66.0],\n [4389, 134.0],\n [4446, 157.0],\n [4612, 108.0],\n [4423, 90.0],\n [5690, 116.0],\n [4919, 122.0],\n [4495, 93.0],\n [4527, 95.0],\n [6158, 76.0],\n [5104, 125.0],\n [6000, 78.0],\n [5340, 112.0],\n [3624, 109.0],\n [3847, 117.0],\n [5475, 80.0],\n [3814, 118.0],\n [7206, 151.0],\n [6476, 122.0],\n [5825, 137.0],\n [6373, 102.0],\n [6513, 121.0],\n [4365, 137.0],\n [7414, 116.0],\n [8433, 268.0],\n [8245, 131.0],\n [8308, 130.0],\n [4489, 131.0],\n [5660, 88.0],\n [5748, 111.0],\n [5735, 113.0],\n [7607, 188.0],\n [4814, 118.0],\n [5215, 107.0],\n [4304, 125.0],\n [5945, 143.0],\n [4921, 126.0],\n [4200, 135.0],\n [6078, 77.0],\n [4408, 113.0],\n [5642, 106.0],\n [4951, 141.0],\n [6130, 110.94],\n [4171, 129.0],\n [5076, 106.0],\n [4745, 137.0],\n [7833, 143.0],\n [6648, 102.0],\n [4049, 123.0],\n [6869, 99.0],\n [4200, 100.0],\n [4819, 110.0],\n [4728, 110.0],\n [7500, 48.0],\n [4400, 200.0],\n [6194, 176.0],\n [5346, 110.0],\n [5173, 116.0],\n [4331, 115.0],\n [7074, 82.0],\n [6141, 114.0],\n [4678, 124.0],\n [5625, 80.0],\n [5153, 85.0],\n [6476, 122.0],\n [4546, 143.0],\n [4735, 128.0],\n [6931, 144.0],\n [4334, 90.0],\n [3874, 142.0],\n [7261, 146.0],\n [6500, 92.0],\n [5783, 138.0],\n [5821, 134.0],\n [4607, 145.0],\n [4825, 114.0],\n [4908, 130.0],\n [5323, 125.5],\n [4699, 166.0],\n [5188, 96.0],\n [5053, 95.0],\n [5473, 91.0],\n [5828, 58.0],\n [4316, 146.0],\n [4149, 135.0],\n [4260, 108.0],\n [5000, 110.0],\n [5828, 58.0],\n [6550, 102.0],\n [7305, 141.0],\n [5068, 118.0],\n [4716, 123.0],\n [4462, 143.0],\n [4612, 108.0],\n [7110, 173.0],\n [3755, 106.0],\n [9295, 156.0],\n [5700, 193.0],\n [5082, 98.0],\n [4880, 100.0],\n [7206, 136.0],\n [5772, 114.0],\n [4936, 109.0],\n [8866, 141.0],\n [7143, 280.0],\n [7341, 188.0],\n [4546, 121.0],\n [4752, 144.8],\n [4878, 122.6],\n [4592, 98.0],\n [4847, 111.0],\n [4171, 129.0],\n [4950, 104.65],\n [7143, 147.0],\n [7285, 122.18],\n [5463, 93.0],\n [5616, 78.0],\n [4612, 108.0],\n [4590, 139.0],\n [3755, 114.0],\n [5725, 80.0],\n [4601, 112.6],\n [5186, 243.0],\n [3791, 105.0],\n [5600, 105.0],\n [3514, 148.0],\n [5000, 90.0],\n [4342, 170.0],\n [5000, 120.0],\n [4569, 109.0],\n [4572, 105.0],\n [4783, 115.0],\n [5200, 75.0],\n [6328, 94.83],\n [5463, 108.0],\n [3892, 221.0],\n [4735, 128.0],\n [6452, 124.0],\n [6195, 143.68],\n [4584, 120.0],\n [6130, 110.94],\n [7261, 146.0],\n [7472, 265.0],\n [4814, 118.0],\n [4728, 165.0],\n [5250, 112.0],\n [4364, 123.3],\n [4953, 147.0],\n [6618, 68.0],\n [4862, 123.0],\n [4058, 138.0],\n [4135, 89.0],\n [7981, 105.0],\n [4982, 108.0],\n [5204, 113.0],\n [4756, 143.0],\n [5556, 90.0],\n [3900, 120.0],\n [4389, 175.0],\n [5593, 114.08],\n [3041, 148.0],\n [8781, 141.0],\n [5389, 85.0],\n [5600, 200.0],\n [4934, 105.0],\n [3813, 128.0],\n [8800, 100.0],\n [3546, 132.0],\n [6123, 98.0],\n [5169, 89.0],\n [3791, 105.0],\n [3632, 120.6],\n [4149, 108.0],\n [4142, 113.0],\n [4473, 127.0],\n [8511, 141.0],\n [4660, 94.0],\n [5031, 99.0],\n [5642, 106.0],\n [7899, 157.0],\n [4056, 108.0],\n [4319, 113.0],\n [6844, 102.0],\n [4845, 109.0],\n [4509, 122.0],\n [5000, 110.0],\n [4056, 108.0],\n [12882, 177.0],\n [4883, 102.0],\n [5048, 105.0],\n [5979, 95.0],\n [4936, 109.0],\n [5071, 142.0],\n [5237, 95.49],\n [3791, 105.0],\n [4913, 114.0],\n [4959, 121.0],\n [8477, 151.0],\n [7713, 188.0],\n [5225, 80.0],\n [4710, 110.0],\n [3488, 160.0],\n [4356, 135.0],\n [4400, 120.0],\n [3750, 112.0],\n [4094, 107.0],\n [4936, 109.0],\n [4936, 109.0],\n [4356, 135.0],\n [4400, 120.0],\n [4328, 122.0],\n [4609, 115.0],\n [5243, 95.0],\n [4825, 114.0],\n [6082, 74.0],\n [3821, 78.0],\n [5000, 110.0],\n [4920, 124.0],\n [5616, 78.0],\n [6703, 94.0],\n [4272, 140.0],\n [5153, 85.0],\n [4304, 125.0],\n [3181, 122.0],\n [7143, 49.0],\n [4235, 94.0],\n [4734, 120.0],\n [5538, 108.0],\n [4574, 129.0],\n [3822, 112.0],\n [4592, 115.0],\n [3548, 115.0],\n [4880, 141.0],\n [4545, 147.0],\n [6241, 83.0],\n [9891, 182.0],\n [4493, 142.0],\n [5000, 136.0],\n [5000, 120.0],\n [4645, 90.0],\n [4170, 165.0],\n [5171, 135.0],\n [3831, 130.0],\n [4986, 134.0],\n [6871, 202.03],\n [4546, 110.0],\n [4612, 108.0],\n [3931, 86.0],\n [3715, 126.0],\n [4797, 108.0],\n [4762, 113.0],\n [4299, 114.0],\n [4046, 105.3],\n [6142, 99.0],\n [3322, 189.68],\n [7667, 150.0],\n [4985, 128.0],\n [2706, 85.0],\n [4304, 132.0],\n [5346, 110.0],\n [3384, 133.0],\n [3722, 115.0],\n [3755, 106.0],\n [4780, 100.0],\n [3241, 108.0],\n [4364, 121.0],\n [4304, 132.0],\n [4780, 100.0],\n [3241, 108.0],\n [4364, 121.0],\n [2831, 130.0],\n [4190, 95.0],\n [3791, 105.0],\n [3017, 122.0],\n [8458, 175.0],\n [4342, 117.0],\n [2994, 143.0],\n [4483, 145.0],\n [3345, 116.0],\n [4527, 95.0],\n [4600, 80.0],\n [4804, 112.0],\n [4680, 100.0],\n [6000, 43.0],\n ...]"
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_scatter = df_SHH[['unit_price','area(㎡)']].to_records(index=False).tolist()\n",
    "data_scatter = [list(i) for i in data_scatter]\n",
    "data_scatter"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-19T02:29:42.767367Z",
     "start_time": "2023-11-19T02:29:42.753471100Z"
    }
   },
   "id": "e64f0a390e01fb27"
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "outputs": [
    {
     "data": {
      "text/plain": "[5660.0,\n 8120.0,\n 5689.0,\n 4293.0,\n 4528.0,\n 5391.0,\n 5642.0,\n 5932.0,\n 5152.0,\n 5248.0,\n 5932.0,\n 5616.0,\n 5622.0,\n 6030.0,\n 3889.0,\n 6459.0,\n 6496.0,\n 4069.0,\n 3847.0,\n 5310.0,\n 2895.0,\n 5084.0,\n 6492.0,\n 5300.0,\n 4738.0,\n 6644.0,\n 2484.0,\n 5076.0,\n 7689.0,\n 5150.0,\n 3750.0,\n 2000.0,\n 4131.0,\n 4743.0,\n 10394.0,\n 8530.0,\n 5486.0,\n 3821.0,\n 6898.0,\n 3300.0,\n 5790.0,\n 3346.0,\n 6585.0,\n 2167.0,\n 4873.0,\n 5437.0,\n 4643.0,\n 5354.0,\n 2829.0,\n 3590.0,\n 4190.0,\n 8056.0,\n 3392.0,\n 5075.0,\n 3176.0,\n 5269.0,\n 5000.0,\n 9020.0,\n 5000.0,\n 3209.0,\n 4753.0,\n 4804.0,\n 5969.0,\n 8348.0,\n 4690.0,\n 4408.0,\n 5642.0,\n 5908.0,\n 5269.0,\n 9020.0,\n 5000.0,\n 4753.0,\n 3209.0,\n 8348.0,\n 4690.0,\n 4804.0,\n 5969.0,\n 5642.0,\n 5908.0,\n 7744.0,\n 5141.0,\n 6079.0,\n 6250.0,\n 7786.0,\n 5675.0,\n 5806.0,\n 4580.0,\n 5068.0,\n 6593.0,\n 6223.0,\n 5697.0,\n 5615.0,\n 5791.0,\n 6771.0,\n 7500.0,\n 4319.0,\n 6275.0,\n 3441.0,\n 5200.0,\n 7500.0,\n 4902.0,\n 5764.0,\n 6195.0,\n 6077.0,\n 3900.0,\n 4351.0,\n 7817.0,\n 5675.0,\n 5417.0,\n 3689.0,\n 6154.0,\n 5600.0,\n 6438.0,\n 4694.0,\n 5810.0,\n 5579.0,\n 6800.0,\n 5834.0,\n 4139.0,\n 7053.0,\n 3245.0,\n 5529.0,\n 7744.0,\n 4347.0,\n 5169.0,\n 4800.0,\n 6399.0,\n 7960.0,\n 5834.0,\n 7769.0,\n 7504.0,\n 6560.0,\n 7206.0,\n 6545.0,\n 6545.0,\n 5392.0,\n 9020.0,\n 5000.0,\n 3209.0,\n 4753.0,\n 4690.0,\n 4804.0,\n 8348.0,\n 5969.0,\n 5392.0,\n 4407.0,\n 7150.0,\n 5762.0,\n 7264.0,\n 6241.0,\n 6000.0,\n 5069.0,\n 6050.0,\n 5463.0,\n 5462.0,\n 4894.0,\n 5300.0,\n 5284.0,\n 6738.0,\n 5355.0,\n 5358.0,\n 4425.0,\n 5690.0,\n 7959.0,\n 7907.0,\n 4648.0,\n 5917.0,\n 4351.0,\n 5538.0,\n 5567.0,\n 5582.0,\n 5048.0,\n 6607.0,\n 4170.0,\n 6965.0,\n 6328.0,\n 7734.0,\n 5533.0,\n 4389.0,\n 5660.0,\n 4584.0,\n 5231.0,\n 5627.0,\n 5581.0,\n 6217.0,\n 6463.0,\n 3560.0,\n 4959.0,\n 5592.0,\n 3813.0,\n 5173.0,\n 5044.0,\n 5509.0,\n 8051.0,\n 6416.0,\n 6073.0,\n 5600.0,\n 4255.0,\n 6277.0,\n 6647.0,\n 5902.0,\n 4462.0,\n 5743.0,\n 4814.0,\n 7079.0,\n 6617.0,\n 6399.0,\n 6403.0,\n 6667.0,\n 7295.0,\n 7305.0,\n 5861.0,\n 7504.0,\n 6965.0,\n 7758.0,\n 6369.0,\n 6679.0,\n 5665.0,\n 6103.0,\n 5592.0,\n 6572.0,\n 6438.0,\n 5533.0,\n 6622.0,\n 5090.0,\n 6031.0,\n 7623.0,\n 6292.0,\n 6085.0,\n 7029.0,\n 5200.0,\n 6713.0,\n 6049.0,\n 7040.0,\n 5778.0,\n 6277.0,\n 7780.0,\n 7194.0,\n 7769.0,\n 7014.0,\n 5734.0,\n 5474.0,\n 7473.0,\n 7760.0,\n 6262.0,\n 5932.0,\n 5567.0,\n 6880.0,\n 5316.0,\n 7734.0,\n 5675.0,\n 5538.0,\n 7343.0,\n 7355.0,\n 6614.0,\n 5979.0,\n 5606.0,\n 7425.0,\n 6517.0,\n 6139.0,\n 6771.0,\n 6680.0,\n 6535.0,\n 6476.0,\n 6476.0,\n 6139.0,\n 6771.0,\n 8143.0,\n 6680.0,\n 6535.0,\n 7297.0,\n 5515.0,\n 5484.0,\n 5734.0,\n 6853.0,\n 6544.0,\n 6644.0,\n 5159.0,\n 9768.0,\n 5529.0,\n 8427.0,\n 5284.0,\n 8280.0,\n 7485.0,\n 6541.0,\n 7266.0,\n 6276.0,\n 7764.0,\n 4642.0,\n 9020.0,\n 9020.0,\n 5769.0,\n 5026.0,\n 6250.0,\n 6317.0,\n 6031.0,\n 6985.0,\n 8245.0,\n 6072.0,\n 6034.0,\n 7680.0,\n 6034.0,\n 8245.0,\n 6768.0,\n 5509.0,\n 7047.0,\n 6749.0,\n 5589.0,\n 6667.0,\n 7561.0,\n 5068.0,\n 5323.0,\n 5486.0,\n 6556.0,\n 5740.0,\n 5759.0,\n 5219.0,\n 5979.0,\n 5395.0,\n 7194.0,\n 5746.0,\n 5358.0,\n 5141.0,\n 5917.0,\n 5744.0,\n 6184.0,\n 5061.0,\n 5675.0,\n 7164.0,\n 6050.0,\n 5633.0,\n 5518.0,\n 5068.0,\n 5536.0,\n 5029.0,\n 6230.0,\n 6563.0,\n 5276.0,\n 5238.0,\n 6648.0,\n 5076.0,\n 6117.0,\n 6029.0,\n 7311.0,\n 7660.0,\n 5437.0,\n 5908.0,\n 5029.0,\n 6255.0,\n 6416.0,\n 5550.0,\n 6490.0,\n 7040.0,\n 5353.0,\n 7688.0,\n 5699.0,\n 5407.0,\n 8866.0,\n 5581.0,\n 6070.0,\n 6647.0,\n 6332.0,\n 6237.0,\n 5465.0,\n 8364.0,\n 5171.0,\n 5721.0,\n 6143.0,\n 5218.0,\n 7758.0,\n 6139.0,\n 7047.0,\n 7095.0,\n 5487.0,\n 5400.0,\n 6848.0,\n 5417.0,\n 7817.0,\n 5411.0,\n 5260.0,\n 5763.0,\n 4625.0,\n 5417.0,\n 5417.0,\n 5417.0,\n 7817.0,\n 5411.0,\n 5260.0,\n 6463.0,\n 5360.0,\n 5381.0,\n 5238.0,\n 5340.0,\n 5053.0,\n 5359.0,\n 5721.0,\n 7679.0,\n 6159.0,\n 7138.0,\n 5029.0,\n 7242.0,\n 5759.0,\n 5164.0,\n 7480.0,\n 5404.0,\n 7421.0,\n 6856.0,\n 7659.0,\n 5200.0,\n 6208.0,\n 6250.0,\n 8038.0,\n 5972.0,\n 6105.0,\n 7322.0,\n 6092.0,\n 5475.0,\n 6016.0,\n 6031.0,\n 5979.0,\n 7223.0,\n 5182.0,\n 7139.0,\n 7308.0,\n 6227.0,\n 5272.0,\n 6150.0,\n 6195.0,\n 5093.0,\n 8263.0,\n 5969.0,\n 6031.0,\n 5604.0,\n 7481.0,\n 6624.0,\n 7942.0,\n 7984.0,\n 7340.0,\n 5983.0,\n 6217.0,\n 5141.0,\n 5715.0,\n 6463.0,\n 5959.0,\n 5600.0,\n 5946.0,\n 5072.0,\n 6489.0,\n 5110.0,\n 5463.0,\n 7296.0,\n 6056.0,\n 6463.0,\n 6137.0,\n 5912.0,\n 6148.0,\n 5538.0,\n 7907.0,\n 7322.0,\n 7565.0,\n 4984.0,\n 5809.0,\n 5286.0,\n 7677.0,\n 7311.0,\n 5672.0,\n 7413.0,\n 5766.0,\n 5690.0,\n 6646.0,\n 5867.0,\n 6882.0,\n 5667.0,\n 5735.0,\n 5697.0,\n 5369.0,\n 5141.0,\n 8368.0,\n 8051.0,\n 6179.0,\n 5353.0,\n 5355.0,\n 6234.0,\n 6771.0,\n 6704.0,\n 6436.0,\n 7046.0,\n 5353.0,\n 5577.0,\n 6075.0,\n 5156.0,\n 5610.0,\n 6926.0,\n 4984.0,\n 8099.0,\n 5176.0,\n 6286.0,\n 9545.0,\n 8058.0,\n 7000.0,\n 7422.0,\n 5660.0,\n 5721.0,\n 5340.0,\n 5721.0,\n 5150.0,\n 6000.0,\n 5624.0,\n 7479.0,\n 7305.0,\n 6970.0,\n 7181.0,\n 5026.0,\n 5640.0,\n 4897.0,\n 7700.0,\n 5722.0,\n 6838.0,\n 7268.0,\n 6077.0,\n 5375.0,\n 4888.0,\n 6070.0,\n 6075.0,\n 5372.0,\n 5029.0,\n 6312.0,\n 5902.0,\n 5740.0,\n 6477.0,\n 5865.0,\n 6000.0,\n 4671.0,\n 5359.0,\n 6619.0,\n 5734.0,\n 6863.0,\n 5660.0,\n 7877.0,\n 6229.0,\n 5044.0,\n 5112.0,\n 5642.0,\n 4655.0,\n 7837.0,\n 5059.0,\n 5308.0,\n 6073.0,\n 7904.0,\n 5203.0,\n 6714.0,\n 5293.0,\n 8370.0,\n 8182.0,\n 5368.0,\n 5618.0,\n 5029.0,\n 4528.0,\n 4770.0,\n 6730.0,\n 6590.0,\n 7747.0,\n 6250.0,\n 7038.0,\n 5949.0,\n 7112.0,\n 5358.0,\n 6275.0,\n 5243.0,\n 6165.0,\n 5979.0,\n 5339.0,\n 8143.0,\n 7414.0,\n 4958.0,\n 5076.0,\n 8193.0,\n 6602.0,\n 5184.0,\n 4379.0,\n 5486.0,\n 6323.0,\n 7869.0,\n 6878.0,\n 4800.0,\n 6838.0,\n 5675.0,\n 5690.0,\n 7899.0,\n 6416.0,\n 7219.0,\n 6819.0,\n 7061.0,\n 5293.0,\n 5741.0,\n 5767.0,\n 7739.0,\n 4408.0,\n 6866.0,\n 6572.0,\n 6985.0,\n 7261.0,\n 6274.0,\n 5986.0,\n 5260.0,\n 5164.0,\n 4342.0,\n 6416.0,\n 6000.0,\n 5908.0,\n 8971.0,\n 4569.0,\n 4941.0,\n 4870.0,\n 7767.0,\n 6250.0,\n 5581.0,\n 5164.0,\n 5577.0,\n 7112.0,\n 6274.0,\n 8971.0,\n 6250.0,\n 6250.0,\n 4870.0,\n 7767.0,\n 6250.0,\n 5164.0,\n 5577.0,\n 5721.0,\n 5924.0,\n 4980.0,\n 5469.0,\n 5260.0,\n 4309.0,\n 6159.0,\n 5556.0,\n 6838.0,\n 8051.0,\n 5636.0,\n 5273.0,\n 5339.0,\n 8713.0,\n 4672.0,\n 7634.0,\n 5200.0,\n 4442.0,\n 5116.0,\n 10899.0,\n 4445.0,\n 5259.0,\n 5791.0,\n 5762.0,\n 7436.0,\n 4575.0,\n 6295.0,\n 6539.0,\n 5978.0,\n 6054.0,\n 5930.0,\n 6062.0,\n 5753.0,\n 5052.0,\n 4546.0,\n 4425.0,\n 6811.0,\n 5137.0,\n 5735.0,\n 6130.0,\n 5271.0,\n 5340.0,\n 7596.0,\n 4853.0,\n 8410.0,\n 6158.0,\n 5213.0,\n 4750.0,\n 5179.0,\n 5642.0,\n 5785.0,\n 4208.0,\n 9236.0,\n 5173.0,\n 7268.0,\n 6274.0,\n 6137.0,\n 4777.0,\n 4728.0,\n 5432.0,\n 5475.0,\n 4662.0,\n 4752.0,\n 7959.0,\n 5135.0,\n 5184.0,\n 9549.0,\n 4635.0,\n 5073.0,\n 5473.0,\n 4447.0,\n 7847.0,\n 5120.0,\n 6730.0,\n 9007.0,\n 6264.0,\n 8276.0,\n 5437.0,\n 4737.0,\n 5791.0,\n 3664.0,\n 5487.0,\n 5410.0,\n 8308.0,\n 8588.0,\n 8509.0,\n 4874.0,\n 6485.0,\n 4389.0,\n 4446.0,\n 4612.0,\n 4423.0,\n 5690.0,\n 4919.0,\n 4495.0,\n 4527.0,\n 6158.0,\n 5104.0,\n 6000.0,\n 5340.0,\n 3624.0,\n 3847.0,\n 5475.0,\n 3814.0,\n 7206.0,\n 6476.0,\n 5825.0,\n 6373.0,\n 6513.0,\n 4365.0,\n 7414.0,\n 8433.0,\n 8245.0,\n 8308.0,\n 4489.0,\n 5660.0,\n 5748.0,\n 5735.0,\n 7607.0,\n 4814.0,\n 5215.0,\n 4304.0,\n 5945.0,\n 4921.0,\n 4200.0,\n 6078.0,\n 4408.0,\n 5642.0,\n 4951.0,\n 6130.0,\n 4171.0,\n 5076.0,\n 4745.0,\n 7833.0,\n 6648.0,\n 4049.0,\n 6869.0,\n 4200.0,\n 4819.0,\n 4728.0,\n 7500.0,\n 4400.0,\n 6194.0,\n 5346.0,\n 5173.0,\n 4331.0,\n 7074.0,\n 6141.0,\n 4678.0,\n 5625.0,\n 5153.0,\n 6476.0,\n 4546.0,\n 4735.0,\n 6931.0,\n 4334.0,\n 3874.0,\n 7261.0,\n 6500.0,\n 5783.0,\n 5821.0,\n 4607.0,\n 4825.0,\n 4908.0,\n 5323.0,\n 4699.0,\n 5188.0,\n 5053.0,\n 5473.0,\n 5828.0,\n 4316.0,\n 4149.0,\n 4260.0,\n 5000.0,\n 5828.0,\n 6550.0,\n 7305.0,\n 5068.0,\n 4716.0,\n 4462.0,\n 4612.0,\n 7110.0,\n 3755.0,\n 9295.0,\n 5700.0,\n 5082.0,\n 4880.0,\n 7206.0,\n 5772.0,\n 4936.0,\n 8866.0,\n 7143.0,\n 7341.0,\n 4546.0,\n 4752.0,\n 4878.0,\n 4592.0,\n 4847.0,\n 4171.0,\n 4950.0,\n 7143.0,\n 7285.0,\n 5463.0,\n 5616.0,\n 4612.0,\n 4590.0,\n 3755.0,\n 5725.0,\n 4601.0,\n 5186.0,\n 3791.0,\n 5600.0,\n 3514.0,\n 5000.0,\n 4342.0,\n 5000.0,\n 4569.0,\n 4572.0,\n 4783.0,\n 5200.0,\n 6328.0,\n 5463.0,\n 3892.0,\n 4735.0,\n 6452.0,\n 6195.0,\n 4584.0,\n 6130.0,\n 7261.0,\n 7472.0,\n 4814.0,\n 4728.0,\n 5250.0,\n 4364.0,\n 4953.0,\n 6618.0,\n 4862.0,\n 4058.0,\n 4135.0,\n 7981.0,\n 4982.0,\n 5204.0,\n 4756.0,\n 5556.0,\n 3900.0,\n 4389.0,\n 5593.0,\n 3041.0,\n 8781.0,\n 5389.0,\n 5600.0,\n 4934.0,\n 3813.0,\n 8800.0,\n 3546.0,\n 6123.0,\n 5169.0,\n 3791.0,\n 3632.0,\n 4149.0,\n 4142.0,\n 4473.0,\n 8511.0,\n 4660.0,\n 5031.0,\n 5642.0,\n 7899.0,\n 4056.0,\n 4319.0,\n 6844.0,\n 4845.0,\n 4509.0,\n 5000.0,\n 4056.0,\n 12882.0,\n 4883.0,\n 5048.0,\n 5979.0,\n 4936.0,\n 5071.0,\n 5237.0,\n 3791.0,\n 4913.0,\n 4959.0,\n 8477.0,\n 7713.0,\n 5225.0,\n 4710.0,\n 3488.0,\n 4356.0,\n 4400.0,\n 3750.0,\n 4094.0,\n 4936.0,\n 4936.0,\n 4356.0,\n 4400.0,\n 4328.0,\n 4609.0,\n 5243.0,\n 4825.0,\n 6082.0,\n 3821.0,\n 5000.0,\n 4920.0,\n 5616.0,\n 6703.0,\n 4272.0,\n 5153.0,\n 4304.0,\n 3181.0,\n 7143.0,\n 4235.0,\n 4734.0,\n 5538.0,\n 4574.0,\n 3822.0,\n 4592.0,\n 3548.0,\n 4880.0,\n 4545.0,\n 6241.0,\n 9891.0,\n 4493.0,\n 5000.0,\n 5000.0,\n 4645.0,\n 4170.0,\n 5171.0,\n 3831.0,\n 4986.0,\n 6871.0,\n 4546.0,\n 4612.0,\n 3931.0,\n 3715.0,\n 4797.0,\n 4762.0,\n 4299.0,\n 4046.0,\n 6142.0,\n 3322.0,\n 7667.0,\n 4985.0,\n 2706.0,\n 4304.0,\n 5346.0,\n 3384.0,\n 3722.0,\n 3755.0,\n 4780.0,\n 3241.0,\n 4364.0,\n 4304.0,\n 4780.0,\n 3241.0,\n 4364.0,\n 2831.0,\n 4190.0,\n 3791.0,\n 3017.0,\n 8458.0,\n 4342.0,\n 2994.0,\n 4483.0,\n 3345.0,\n 4527.0,\n 4600.0,\n 4804.0,\n 4680.0,\n 6000.0,\n ...]"
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np1 = df_SHH[['unit_price','area(㎡)']].to_numpy()\n",
    "(np1[:,0])"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-19T03:09:44.862709500Z",
     "start_time": "2023-11-19T03:09:44.858132300Z"
    }
   },
   "id": "5693a9878a7cb7ce"
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "[[5660.0, 88.0],\n [8120.0, 117.0],\n [5689.0, 135.0],\n [4293.0, 130.0],\n [4528.0, 110.0],\n [5391.0, 128.0],\n [5642.0, 106.0],\n [5932.0, 145.0],\n [5152.0, 99.0],\n [5248.0, 93.0],\n [5932.0, 145.0],\n [5616.0, 130.0],\n [5622.0, 112.07],\n [6030.0, 136.0],\n [3889.0, 90.0],\n [6459.0, 48.0],\n [6496.0, 109.0],\n [4069.0, 147.0],\n [3847.0, 143.0],\n [5310.0, 113.0],\n [2895.0, 114.0],\n [5084.0, 96.0],\n [6492.0, 57.0],\n [5300.0, 100.0],\n [4738.0, 103.0],\n [6644.0, 143.0],\n [2484.0, 120.0],\n [5076.0, 106.0],\n [7689.0, 122.0],\n [5150.0, 167.0],\n [3750.0, 120.0],\n [2000.0, 80.0],\n [4131.0, 92.0],\n [4743.0, 105.0],\n [10394.0, 178.0],\n [8530.0, 170.0],\n [5486.0, 140.0],\n [3821.0, 78.0],\n [6898.0, 107.0],\n [3300.0, 60.0],\n [5790.0, 108.81],\n [3346.0, 110.0],\n [6585.0, 106.0],\n [2167.0, 120.0],\n [4873.0, 55.0],\n [5437.0, 110.0],\n [4643.0, 168.0],\n [5354.0, 112.07],\n [2829.0, 70.0],\n [3590.0, 156.0],\n [4190.0, 95.0],\n [8056.0, 108.0],\n [3392.0, 138.0],\n [5075.0, 117.85],\n [3176.0, 97.0],\n [5269.0, 94.91],\n [5000.0, 120.0],\n [9020.0, 155.0],\n [5000.0, 120.0],\n [3209.0, 96.0],\n [4753.0, 113.2],\n [4804.0, 112.0],\n [5969.0, 127.0],\n [8348.0, 115.0],\n [4690.0, 145.0],\n [4408.0, 113.0],\n [5642.0, 106.0],\n [5908.0, 130.0],\n [5269.0, 94.91],\n [9020.0, 155.0],\n [5000.0, 120.0],\n [4753.0, 113.2],\n [3209.0, 96.0],\n [8348.0, 115.0],\n [4690.0, 145.0],\n [4804.0, 112.0],\n [5969.0, 127.0],\n [5642.0, 106.0],\n [5908.0, 130.0],\n [7744.0, 125.0],\n [5141.0, 107.0],\n [6079.0, 128.0],\n [6250.0, 120.0],\n [7786.0, 124.34],\n [5675.0, 123.0],\n [5806.0, 101.63],\n [4580.0, 107.0],\n [5068.0, 118.0],\n [6593.0, 135.0],\n [6223.0, 135.0],\n [5697.0, 112.0],\n [5615.0, 135.0],\n [5791.0, 86.0],\n [6771.0, 109.0],\n [7500.0, 140.0],\n [4319.0, 113.0],\n [6275.0, 124.0],\n [3441.0, 168.0],\n [5200.0, 115.0],\n [7500.0, 140.0],\n [4902.0, 153.0],\n [5764.0, 105.83],\n [6195.0, 103.0],\n [6077.0, 130.0],\n [3900.0, 120.0],\n [4351.0, 124.11],\n [7817.0, 120.0],\n [5675.0, 123.0],\n [5417.0, 96.0],\n [3689.0, 154.0],\n [6154.0, 104.0],\n [5600.0, 125.0],\n [6438.0, 122.4],\n [4694.0, 98.0],\n [5810.0, 130.82],\n [5579.0, 95.0],\n [6800.0, 125.0],\n [5834.0, 96.0],\n [4139.0, 130.0],\n [7053.0, 133.0],\n [3245.0, 172.0],\n [5529.0, 123.0],\n [7744.0, 125.0],\n [4347.0, 124.24],\n [5169.0, 89.0],\n [4800.0, 125.0],\n [6399.0, 118.0],\n [7960.0, 98.0],\n [5834.0, 96.0],\n [7769.0, 95.0],\n [7504.0, 133.0],\n [6560.0, 143.0],\n [7206.0, 136.0],\n [6545.0, 136.0],\n [6545.0, 136.0],\n [5392.0, 115.0],\n [9020.0, 155.0],\n [5000.0, 120.0],\n [3209.0, 96.0],\n [4753.0, 113.2],\n [4690.0, 145.0],\n [4804.0, 112.0],\n [8348.0, 115.0],\n [5969.0, 127.0],\n [5392.0, 115.0],\n [4407.0, 118.0],\n [7150.0, 120.0],\n [5762.0, 109.0],\n [7264.0, 110.0],\n [6241.0, 83.0],\n [6000.0, 130.0],\n [5069.0, 116.0],\n [6050.0, 162.0],\n [5463.0, 93.0],\n [5462.0, 130.0],\n [4894.0, 94.0],\n [5300.0, 100.0],\n [5284.0, 115.45],\n [6738.0, 141.0],\n [5355.0, 93.0],\n [5358.0, 112.0],\n [4425.0, 113.0],\n [5690.0, 116.0],\n [7959.0, 96.5],\n [7907.0, 129.0],\n [4648.0, 142.0],\n [5917.0, 96.0],\n [4351.0, 124.11],\n [5538.0, 108.0],\n [5567.0, 120.0],\n [5582.0, 129.0],\n [5048.0, 105.0],\n [6607.0, 145.0],\n [4170.0, 165.0],\n [6965.0, 112.0],\n [6328.0, 94.83],\n [7734.0, 120.0],\n [5533.0, 122.0],\n [4389.0, 175.0],\n [5660.0, 128.98],\n [4584.0, 120.0],\n [5231.0, 130.0],\n [5627.0, 117.31],\n [5581.0, 143.0],\n [6217.0, 148.0],\n [6463.0, 108.0],\n [3560.0, 168.0],\n [4959.0, 121.0],\n [5592.0, 93.0],\n [3813.0, 128.0],\n [5173.0, 116.0],\n [5044.0, 115.0],\n [5509.0, 114.0],\n [8051.0, 118.0],\n [6416.0, 106.0],\n [6073.0, 110.0],\n [5600.0, 130.0],\n [4255.0, 110.0],\n [6277.0, 159.0],\n [6647.0, 102.31],\n [5902.0, 122.0],\n [4462.0, 143.0],\n [5743.0, 132.0],\n [4814.0, 118.0],\n [7079.0, 141.0],\n [6617.0, 133.0],\n [6399.0, 118.0],\n [6403.0, 139.0],\n [6667.0, 129.0],\n [7295.0, 156.0],\n [7305.0, 141.0],\n [5861.0, 143.0],\n [7504.0, 145.0],\n [6965.0, 112.0],\n [7758.0, 99.0],\n [6369.0, 152.0],\n [6679.0, 143.0],\n [5665.0, 143.0],\n [6103.0, 136.0],\n [5592.0, 93.0],\n [6572.0, 91.0],\n [6438.0, 122.4],\n [5533.0, 137.0],\n [6622.0, 119.0],\n [5090.0, 112.0],\n [6031.0, 131.0],\n [7623.0, 127.0],\n [6292.0, 103.0],\n [6085.0, 118.0],\n [7029.0, 105.0],\n [5200.0, 115.0],\n [6713.0, 146.0],\n [6049.0, 165.0],\n [7040.0, 125.0],\n [5778.0, 135.0],\n [6277.0, 159.0],\n [7780.0, 145.0],\n [7194.0, 129.0],\n [7769.0, 95.0],\n [7014.0, 109.07],\n [5734.0, 120.0],\n [5474.0, 133.0],\n [7473.0, 91.0],\n [7760.0, 125.0],\n [6262.0, 95.5],\n [5932.0, 145.0],\n [5567.0, 120.0],\n [6880.0, 116.0],\n [5316.0, 118.15],\n [7734.0, 120.0],\n [5675.0, 123.0],\n [5538.0, 108.0],\n [7343.0, 143.0],\n [7355.0, 189.0],\n [6614.0, 189.0],\n [5979.0, 92.0],\n [5606.0, 137.0],\n [7425.0, 132.0],\n [6517.0, 122.0],\n [6139.0, 130.0],\n [6771.0, 109.0],\n [6680.0, 108.99],\n [6535.0, 101.0],\n [6476.0, 122.0],\n [6476.0, 122.0],\n [6139.0, 130.0],\n [6771.0, 109.0],\n [8143.0, 98.0],\n [6680.0, 108.99],\n [6535.0, 101.0],\n [7297.0, 108.0],\n [5515.0, 136.0],\n [5484.0, 120.0],\n [5734.0, 120.0],\n [6853.0, 115.0],\n [6544.0, 125.0],\n [6644.0, 143.0],\n [5159.0, 126.0],\n [9768.0, 129.0],\n [5529.0, 123.0],\n [8427.0, 122.0],\n [5284.0, 106.0],\n [8280.0, 100.0],\n [7485.0, 128.0],\n [6541.0, 122.0],\n [7266.0, 128.0],\n [6276.0, 116.0],\n [7764.0, 152.0],\n [4642.0, 159.0],\n [9020.0, 155.0],\n [9020.0, 155.0],\n [5769.0, 121.0],\n [5026.0, 117.0],\n [6250.0, 104.0],\n [6317.0, 120.0],\n [6031.0, 131.0],\n [6985.0, 126.0],\n [8245.0, 131.0],\n [6072.0, 112.0],\n [6034.0, 119.0],\n [7680.0, 100.0],\n [6034.0, 119.0],\n [8245.0, 131.0],\n [6768.0, 112.0],\n [5509.0, 114.0],\n [7047.0, 149.0],\n [6749.0, 139.0],\n [5589.0, 107.0],\n [6667.0, 132.0],\n [7561.0, 123.0],\n [5068.0, 118.0],\n [5323.0, 118.0],\n [5486.0, 140.0],\n [6556.0, 198.0],\n [5740.0, 92.0],\n [5759.0, 116.0],\n [5219.0, 128.0],\n [5979.0, 95.0],\n [5395.0, 109.0],\n [7194.0, 129.0],\n [5746.0, 118.0],\n [5358.0, 112.0],\n [5141.0, 107.0],\n [5917.0, 96.0],\n [5744.0, 125.0],\n [6184.0, 117.74],\n [5061.0, 164.0],\n [5675.0, 123.0],\n [7164.0, 177.0],\n [6050.0, 162.0],\n [5633.0, 147.0],\n [5518.0, 112.0],\n [5068.0, 118.0],\n [5536.0, 112.0],\n [5029.0, 107.0],\n [6230.0, 96.0],\n [6563.0, 96.0],\n [5276.0, 138.0],\n [5238.0, 122.0],\n [6648.0, 102.0],\n [5076.0, 106.0],\n [6117.0, 137.0],\n [6029.0, 139.0],\n [7311.0, 145.0],\n [7660.0, 141.0],\n [5437.0, 110.0],\n [5908.0, 108.0],\n [5029.0, 107.0],\n [6255.0, 102.0],\n [6416.0, 106.0],\n [5550.0, 151.0],\n [6490.0, 143.0],\n [7040.0, 125.0],\n [5353.0, 136.0],\n [7688.0, 96.0],\n [5699.0, 93.0],\n [5407.0, 118.0],\n [8866.0, 141.0],\n [5581.0, 143.0],\n [6070.0, 143.0],\n [6647.0, 102.31],\n [6332.0, 91.6],\n [6237.0, 93.0],\n [5465.0, 136.89],\n [8364.0, 99.0],\n [5171.0, 135.0],\n [5721.0, 136.0],\n [6143.0, 112.0],\n [5218.0, 138.0],\n [7758.0, 99.0],\n [6139.0, 130.0],\n [7047.0, 149.0],\n [7095.0, 117.0],\n [5487.0, 109.0],\n [5400.0, 120.0],\n [6848.0, 92.0],\n [5417.0, 120.0],\n [7817.0, 120.0],\n [5411.0, 129.0],\n [5260.0, 108.0],\n [5763.0, 135.0],\n [4625.0, 112.0],\n [5417.0, 120.0],\n [5417.0, 120.0],\n [5417.0, 120.0],\n [7817.0, 120.0],\n [5411.0, 129.0],\n [5260.0, 108.0],\n [6463.0, 108.0],\n [5360.0, 125.0],\n [5381.0, 126.0],\n [5238.0, 139.0],\n [5340.0, 112.0],\n [5053.0, 120.34],\n [5359.0, 106.0],\n [5721.0, 136.0],\n [7679.0, 143.0],\n [6159.0, 177.0],\n [7138.0, 102.0],\n [5029.0, 107.0],\n [7242.0, 124.0],\n [5759.0, 116.0],\n [5164.0, 141.0],\n [7480.0, 123.0],\n [5404.0, 124.0],\n [7421.0, 145.0],\n [6856.0, 159.0],\n [7659.0, 193.0],\n [5200.0, 115.0],\n [6208.0, 135.0],\n [6250.0, 120.0],\n [8038.0, 108.0],\n [5972.0, 107.0],\n [6105.0, 96.0],\n [7322.0, 109.0],\n [6092.0, 131.0],\n [5475.0, 137.0],\n [6016.0, 131.0],\n [6031.0, 131.0],\n [5979.0, 95.0],\n [7223.0, 108.0],\n [5182.0, 154.0],\n [7139.0, 137.0],\n [7308.0, 127.0],\n [6227.0, 106.0],\n [5272.0, 140.0],\n [6150.0, 120.0],\n [6195.0, 103.0],\n [5093.0, 108.0],\n [8263.0, 145.0],\n [5969.0, 127.0],\n [6031.0, 131.0],\n [5604.0, 116.0],\n [7481.0, 131.0],\n [6624.0, 125.0],\n [7942.0, 171.0],\n [7984.0, 125.0],\n [7340.0, 109.0],\n [5983.0, 117.0],\n [6217.0, 148.0],\n [5141.0, 107.0],\n [5715.0, 154.0],\n [6463.0, 108.0],\n [5959.0, 120.0],\n [5600.0, 200.0],\n [5946.0, 148.0],\n [5072.0, 112.0],\n [6489.0, 131.0],\n [5110.0, 119.0],\n [5463.0, 108.0],\n [7296.0, 122.0],\n [6056.0, 180.0],\n [6463.0, 108.0],\n [6137.0, 117.0],\n [5912.0, 113.0],\n [6148.0, 122.0],\n [5538.0, 108.0],\n [7907.0, 129.0],\n [7322.0, 109.0],\n [7565.0, 124.0],\n [4984.0, 120.0],\n [5809.0, 115.0],\n [5286.0, 98.0],\n [7677.0, 99.0],\n [7311.0, 145.0],\n [5672.0, 134.0],\n [7413.0, 107.65],\n [5766.0, 128.0],\n [5690.0, 116.0],\n [6646.0, 96.0],\n [5867.0, 118.99],\n [6882.0, 130.5],\n [5667.0, 90.0],\n [5735.0, 113.0],\n [5697.0, 112.0],\n [5369.0, 103.0],\n [5141.0, 107.0],\n [8368.0, 147.0],\n [8051.0, 118.0],\n [6179.0, 123.0],\n [5353.0, 136.0],\n [5355.0, 93.0],\n [6234.0, 150.0],\n [6771.0, 109.0],\n [6704.0, 125.0],\n [6436.0, 101.0],\n [7046.0, 109.0],\n [5353.0, 136.0],\n [5577.0, 118.0],\n [6075.0, 107.0],\n [5156.0, 116.0],\n [5610.0, 128.0],\n [6926.0, 108.0],\n [4984.0, 118.0],\n [8099.0, 142.0],\n [5176.0, 131.0],\n [6286.0, 140.0],\n [9545.0, 155.06],\n [8058.0, 139.0],\n [7000.0, 114.0],\n [7422.0, 159.0],\n [5660.0, 141.0],\n [5721.0, 129.0],\n [5340.0, 112.0],\n [5721.0, 129.0],\n [5150.0, 167.0],\n [6000.0, 130.0],\n [5624.0, 101.0],\n [7479.0, 122.75],\n [7305.0, 141.0],\n [6970.0, 198.0],\n [7181.0, 188.0],\n [5026.0, 117.0],\n [5640.0, 136.18],\n [4897.0, 116.0],\n [7700.0, 100.0],\n [5722.0, 115.0],\n [6838.0, 203.0],\n [7268.0, 162.36],\n [6077.0, 130.0],\n [5375.0, 160.0],\n [4888.0, 133.0],\n [6070.0, 143.0],\n [6075.0, 107.0],\n [5372.0, 156.0],\n [5029.0, 173.0],\n [6312.0, 122.0],\n [5902.0, 115.23],\n [5740.0, 92.0],\n [6477.0, 105.0],\n [5865.0, 133.0],\n [6000.0, 103.0],\n [4671.0, 158.0],\n [5359.0, 162.0],\n [6619.0, 110.0],\n [5734.0, 120.0],\n [6863.0, 142.8],\n [5660.0, 88.0],\n [7877.0, 146.0],\n [6229.0, 114.0],\n [5044.0, 115.0],\n [5112.0, 90.0],\n [5642.0, 106.0],\n [4655.0, 165.0],\n [7837.0, 98.0],\n [5059.0, 136.0],\n [5308.0, 130.0],\n [6073.0, 110.0],\n [7904.0, 415.0],\n [5203.0, 138.0],\n [6714.0, 119.01],\n [5293.0, 113.0],\n [8370.0, 130.0],\n [8182.0, 165.0],\n [5368.0, 136.0],\n [5618.0, 89.0],\n [5029.0, 107.0],\n [4528.0, 110.0],\n [4770.0, 130.0],\n [6730.0, 74.0],\n [6590.0, 129.0],\n [7747.0, 142.0],\n [6250.0, 104.0],\n [7038.0, 189.0],\n [5949.0, 77.0],\n [7112.0, 108.0],\n [5358.0, 140.0],\n [6275.0, 124.0],\n [5243.0, 95.0],\n [6165.0, 97.0],\n [5979.0, 92.0],\n [5339.0, 142.0],\n [8143.0, 98.0],\n [7414.0, 116.0],\n [4958.0, 117.0],\n [5076.0, 106.0],\n [8193.0, 177.0],\n [6602.0, 103.0],\n [5184.0, 98.0],\n [4379.0, 164.0],\n [5486.0, 140.0],\n [6323.0, 93.0],\n [7869.0, 198.0],\n [6878.0, 180.0],\n [4800.0, 125.0],\n [6838.0, 203.0],\n [5675.0, 123.0],\n [5690.0, 116.0],\n [7899.0, 157.0],\n [6416.0, 106.0],\n [7219.0, 143.79],\n [6819.0, 198.0],\n [7061.0, 198.0],\n [5293.0, 113.0],\n [5741.0, 108.0],\n [5767.0, 154.0],\n [7739.0, 168.0],\n [4408.0, 113.0],\n [6866.0, 141.0],\n [6572.0, 147.0],\n [6985.0, 126.0],\n [7261.0, 146.0],\n [6274.0, 212.0],\n [5986.0, 140.0],\n [5260.0, 108.0],\n [5164.0, 306.0],\n [4342.0, 170.0],\n [6416.0, 106.0],\n [6000.0, 98.0],\n [5908.0, 130.0],\n [8971.0, 136.0],\n [4569.0, 109.0],\n [4941.0, 168.0],\n [4870.0, 115.0],\n [7767.0, 206.0],\n [6250.0, 104.0],\n [5581.0, 143.0],\n [5164.0, 110.0],\n [5577.0, 118.0],\n [7112.0, 108.0],\n [6274.0, 212.0],\n [8971.0, 136.0],\n [6250.0, 104.0],\n [6250.0, 104.0],\n [4870.0, 115.0],\n [7767.0, 206.0],\n [6250.0, 104.0],\n [5164.0, 110.0],\n [5577.0, 118.0],\n [5721.0, 136.0],\n [5924.0, 130.0],\n [4980.0, 100.0],\n [5469.0, 128.0],\n [5260.0, 108.0],\n [4309.0, 162.0],\n [6159.0, 63.0],\n [5556.0, 45.0],\n [6838.0, 203.0],\n [8051.0, 118.0],\n [5636.0, 129.18],\n [5273.0, 121.0],\n [5339.0, 118.0],\n [8713.0, 132.0],\n [4672.0, 143.0],\n [7634.0, 131.0],\n [5200.0, 115.0],\n [4442.0, 157.16],\n [5116.0, 113.0],\n [10899.0, 89.0],\n [4445.0, 162.0],\n [5259.0, 89.0],\n [5791.0, 86.0],\n [5762.0, 109.0],\n [7436.0, 117.0],\n [4575.0, 94.0],\n [6295.0, 95.0],\n [6539.0, 104.0],\n [5978.0, 87.0],\n [6054.0, 112.0],\n [5930.0, 199.0],\n [6062.0, 97.0],\n [5753.0, 113.0],\n [5052.0, 120.35],\n [4546.0, 99.0],\n [4425.0, 99.0],\n [6811.0, 185.0],\n [5137.0, 95.0],\n [5735.0, 113.0],\n [6130.0, 110.94],\n [5271.0, 85.0],\n [5340.0, 112.0],\n [7596.0, 163.0],\n [4853.0, 136.0],\n [8410.0, 176.0],\n [6158.0, 76.0],\n [5213.0, 94.0],\n [4750.0, 128.0],\n [5179.0, 112.0],\n [5642.0, 106.0],\n [5785.0, 102.0],\n [4208.0, 135.0],\n [9236.0, 157.0],\n [5173.0, 133.0],\n [7268.0, 162.36],\n [6274.0, 212.0],\n [6137.0, 176.0],\n [4777.0, 121.0],\n [4728.0, 165.0],\n [5432.0, 116.0],\n [5475.0, 80.0],\n [4662.0, 118.0],\n [4752.0, 144.8],\n [7959.0, 96.5],\n [5135.0, 134.0],\n [5184.0, 98.0],\n [9549.0, 155.0],\n [4635.0, 123.0],\n [5073.0, 138.0],\n [5473.0, 91.0],\n [4447.0, 112.0],\n [7847.0, 144.02],\n [5120.0, 150.0],\n [6730.0, 74.0],\n [9007.0, 140.79],\n [6264.0, 95.0],\n [8276.0, 130.5],\n [5437.0, 110.0],\n [4737.0, 95.0],\n [5791.0, 86.0],\n [3664.0, 116.0],\n [5487.0, 109.0],\n [5410.0, 105.0],\n [8308.0, 130.0],\n [8588.0, 177.0],\n [8509.0, 122.0],\n [4874.0, 119.0],\n [6485.0, 66.0],\n [4389.0, 134.0],\n [4446.0, 157.0],\n [4612.0, 108.0],\n [4423.0, 90.0],\n [5690.0, 116.0],\n [4919.0, 122.0],\n [4495.0, 93.0],\n [4527.0, 95.0],\n [6158.0, 76.0],\n [5104.0, 125.0],\n [6000.0, 78.0],\n [5340.0, 112.0],\n [3624.0, 109.0],\n [3847.0, 117.0],\n [5475.0, 80.0],\n [3814.0, 118.0],\n [7206.0, 151.0],\n [6476.0, 122.0],\n [5825.0, 137.0],\n [6373.0, 102.0],\n [6513.0, 121.0],\n [4365.0, 137.0],\n [7414.0, 116.0],\n [8433.0, 268.0],\n [8245.0, 131.0],\n [8308.0, 130.0],\n [4489.0, 131.0],\n [5660.0, 88.0],\n [5748.0, 111.0],\n [5735.0, 113.0],\n [7607.0, 188.0],\n [4814.0, 118.0],\n [5215.0, 107.0],\n [4304.0, 125.0],\n [5945.0, 143.0],\n [4921.0, 126.0],\n [4200.0, 135.0],\n [6078.0, 77.0],\n [4408.0, 113.0],\n [5642.0, 106.0],\n [4951.0, 141.0],\n [6130.0, 110.94],\n [4171.0, 129.0],\n [5076.0, 106.0],\n [4745.0, 137.0],\n [7833.0, 143.0],\n [6648.0, 102.0],\n [4049.0, 123.0],\n [6869.0, 99.0],\n [4200.0, 100.0],\n [4819.0, 110.0],\n [4728.0, 110.0],\n [7500.0, 48.0],\n [4400.0, 200.0],\n [6194.0, 176.0],\n [5346.0, 110.0],\n [5173.0, 116.0],\n [4331.0, 115.0],\n [7074.0, 82.0],\n [6141.0, 114.0],\n [4678.0, 124.0],\n [5625.0, 80.0],\n [5153.0, 85.0],\n [6476.0, 122.0],\n [4546.0, 143.0],\n [4735.0, 128.0],\n [6931.0, 144.0],\n [4334.0, 90.0],\n [3874.0, 142.0],\n [7261.0, 146.0],\n [6500.0, 92.0],\n [5783.0, 138.0],\n [5821.0, 134.0],\n [4607.0, 145.0],\n [4825.0, 114.0],\n [4908.0, 130.0],\n [5323.0, 125.5],\n [4699.0, 166.0],\n [5188.0, 96.0],\n [5053.0, 95.0],\n [5473.0, 91.0],\n [5828.0, 58.0],\n [4316.0, 146.0],\n [4149.0, 135.0],\n [4260.0, 108.0],\n [5000.0, 110.0],\n [5828.0, 58.0],\n [6550.0, 102.0],\n [7305.0, 141.0],\n [5068.0, 118.0],\n [4716.0, 123.0],\n [4462.0, 143.0],\n [4612.0, 108.0],\n [7110.0, 173.0],\n [3755.0, 106.0],\n [9295.0, 156.0],\n [5700.0, 193.0],\n [5082.0, 98.0],\n [4880.0, 100.0],\n [7206.0, 136.0],\n [5772.0, 114.0],\n [4936.0, 109.0],\n [8866.0, 141.0],\n [7143.0, 280.0],\n [7341.0, 188.0],\n [4546.0, 121.0],\n [4752.0, 144.8],\n [4878.0, 122.6],\n [4592.0, 98.0],\n [4847.0, 111.0],\n [4171.0, 129.0],\n [4950.0, 104.65],\n [7143.0, 147.0],\n [7285.0, 122.18],\n [5463.0, 93.0],\n [5616.0, 78.0],\n [4612.0, 108.0],\n [4590.0, 139.0],\n [3755.0, 114.0],\n [5725.0, 80.0],\n [4601.0, 112.6],\n [5186.0, 243.0],\n [3791.0, 105.0],\n [5600.0, 105.0],\n [3514.0, 148.0],\n [5000.0, 90.0],\n [4342.0, 170.0],\n [5000.0, 120.0],\n [4569.0, 109.0],\n [4572.0, 105.0],\n [4783.0, 115.0],\n [5200.0, 75.0],\n [6328.0, 94.83],\n [5463.0, 108.0],\n [3892.0, 221.0],\n [4735.0, 128.0],\n [6452.0, 124.0],\n [6195.0, 143.68],\n [4584.0, 120.0],\n [6130.0, 110.94],\n [7261.0, 146.0],\n [7472.0, 265.0],\n [4814.0, 118.0],\n [4728.0, 165.0],\n [5250.0, 112.0],\n [4364.0, 123.3],\n [4953.0, 147.0],\n [6618.0, 68.0],\n [4862.0, 123.0],\n [4058.0, 138.0],\n [4135.0, 89.0],\n [7981.0, 105.0],\n [4982.0, 108.0],\n [5204.0, 113.0],\n [4756.0, 143.0],\n [5556.0, 90.0],\n [3900.0, 120.0],\n [4389.0, 175.0],\n [5593.0, 114.08],\n [3041.0, 148.0],\n [8781.0, 141.0],\n [5389.0, 85.0],\n [5600.0, 200.0],\n [4934.0, 105.0],\n [3813.0, 128.0],\n [8800.0, 100.0],\n [3546.0, 132.0],\n [6123.0, 98.0],\n [5169.0, 89.0],\n [3791.0, 105.0],\n [3632.0, 120.6],\n [4149.0, 108.0],\n [4142.0, 113.0],\n [4473.0, 127.0],\n [8511.0, 141.0],\n [4660.0, 94.0],\n [5031.0, 99.0],\n [5642.0, 106.0],\n [7899.0, 157.0],\n [4056.0, 108.0],\n [4319.0, 113.0],\n [6844.0, 102.0],\n [4845.0, 109.0],\n [4509.0, 122.0],\n [5000.0, 110.0],\n [4056.0, 108.0],\n [12882.0, 177.0],\n [4883.0, 102.0],\n [5048.0, 105.0],\n [5979.0, 95.0],\n [4936.0, 109.0],\n [5071.0, 142.0],\n [5237.0, 95.49],\n [3791.0, 105.0],\n [4913.0, 114.0],\n [4959.0, 121.0],\n [8477.0, 151.0],\n [7713.0, 188.0],\n [5225.0, 80.0],\n [4710.0, 110.0],\n [3488.0, 160.0],\n [4356.0, 135.0],\n [4400.0, 120.0],\n [3750.0, 112.0],\n [4094.0, 107.0],\n [4936.0, 109.0],\n [4936.0, 109.0],\n [4356.0, 135.0],\n [4400.0, 120.0],\n [4328.0, 122.0],\n [4609.0, 115.0],\n [5243.0, 95.0],\n [4825.0, 114.0],\n [6082.0, 74.0],\n [3821.0, 78.0],\n [5000.0, 110.0],\n [4920.0, 124.0],\n [5616.0, 78.0],\n [6703.0, 94.0],\n [4272.0, 140.0],\n [5153.0, 85.0],\n [4304.0, 125.0],\n [3181.0, 122.0],\n [7143.0, 49.0],\n [4235.0, 94.0],\n [4734.0, 120.0],\n [5538.0, 108.0],\n [4574.0, 129.0],\n [3822.0, 112.0],\n [4592.0, 115.0],\n [3548.0, 115.0],\n [4880.0, 141.0],\n [4545.0, 147.0],\n [6241.0, 83.0],\n [9891.0, 182.0],\n [4493.0, 142.0],\n [5000.0, 136.0],\n [5000.0, 120.0],\n [4645.0, 90.0],\n [4170.0, 165.0],\n [5171.0, 135.0],\n [3831.0, 130.0],\n [4986.0, 134.0],\n [6871.0, 202.03],\n [4546.0, 110.0],\n [4612.0, 108.0],\n [3931.0, 86.0],\n [3715.0, 126.0],\n [4797.0, 108.0],\n [4762.0, 113.0],\n [4299.0, 114.0],\n [4046.0, 105.3],\n [6142.0, 99.0],\n [3322.0, 189.68],\n [7667.0, 150.0],\n [4985.0, 128.0],\n [2706.0, 85.0],\n [4304.0, 132.0],\n [5346.0, 110.0],\n [3384.0, 133.0],\n [3722.0, 115.0],\n [3755.0, 106.0],\n [4780.0, 100.0],\n [3241.0, 108.0],\n [4364.0, 121.0],\n [4304.0, 132.0],\n [4780.0, 100.0],\n [3241.0, 108.0],\n [4364.0, 121.0],\n [2831.0, 130.0],\n [4190.0, 95.0],\n [3791.0, 105.0],\n [3017.0, 122.0],\n [8458.0, 175.0],\n [4342.0, 117.0],\n [2994.0, 143.0],\n [4483.0, 145.0],\n [3345.0, 116.0],\n [4527.0, 95.0],\n [4600.0, 80.0],\n [4804.0, 112.0],\n [4680.0, 100.0],\n [6000.0, 43.0],\n ...]"
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_regression_line.values.tolist()\n",
    "df_SHH[['unit_price','area(㎡)']].values.tolist()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-19T14:14:32.407980300Z",
     "start_time": "2023-11-19T14:14:32.379884900Z"
    }
   },
   "id": "60b1fb5962e31f70"
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "outputs": [
    {
     "data": {
      "text/plain": "{'line_data': [5195.477272727273,\n  5429.7,\n  6161.463414634146,\n  3496.0,\n  5273.246376811594,\n  5868.134246575342,\n  6089.028717294193,\n  5282.227272727273,\n  5993.133333333333,\n  6030.191489361702],\n 'bar_data': [44, 40, 123, 2, 69, 1095, 1567, 22, 15, 47],\n 'name': ['东', '东北', '东南', '东西', '北', '南', '南北', '西', '西北', '西南']}"
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "line_data = df_SHH.groupby(['orientation']).agg({'unit_price':['mean']}).reset_index().values[:,1].tolist()\n",
    "name = df_SHH.groupby(['orientation']).agg({'unit_price':['mean']}).reset_index().values[:,0].tolist()\n",
    "bar_data = df_SHH.groupby(['orientation']).count().reset_index().values[:,1].tolist()\n",
    "{\n",
    "    'line_data':line_data,\n",
    "    'bar_data':bar_data,\n",
    "    'name':name\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-20T07:53:36.134458600Z",
     "start_time": "2023-11-20T07:53:36.111318200Z"
    }
   },
   "id": "f95f972bf0703195"
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "outputs": [
    {
     "data": {
      "text/plain": "[{'name': '低单价', 'value': 18},\n {'name': '低容积', 'value': 19},\n {'name': '低总价', 'value': 25},\n {'name': '大户型', 'value': 140},\n {'name': '学校', 'value': 107},\n {'name': '小户型', 'value': 5},\n {'name': '得房率高', 'value': 1},\n {'name': '装修交付', 'value': 35},\n {'name': '购物中心', 'value': 65},\n {'name': '车位充足', 'value': 69},\n {'name': '配套纯熟', 'value': 77},\n {'name': '高绿化率', 'value': 37},\n {'name': '唯一住房', 'value': 124},\n {'name': '推荐新房', 'value': 434},\n {'name': '新上', 'value': 803},\n {'name': '满二唯一', 'value': 497},\n {'name': '满二年', 'value': 811},\n {'name': '满五唯一', 'value': 330},\n {'name': '满五年', 'value': 274}]"
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_NH_wordcloud = df_NH.drop('tag', axis=1).join(\n",
    "        df_NH['tag'].str.split(',', expand=True).stack().reset_index(level=1, drop=True).rename('tag'))\n",
    "df_SHH_wordcloud = df_SHH.drop('tag', axis=1).join(\n",
    "        df_SHH['tag'].str.split(',', expand=True).stack().reset_index(level=1, drop=True).rename('tag'))\n",
    "df_NH_wordcloud = df_NH_wordcloud[df_NH_wordcloud['tag'] != '无']\n",
    "df_SHH_wordcloud = df_SHH_wordcloud[df_SHH_wordcloud['tag'] != '无']\n",
    "wordcloud_NH_data = df_NH_wordcloud.groupby(['tag']).count().reset_index().values[:,:2].tolist()\n",
    "wordcloud_SHH_data = df_SHH_wordcloud.groupby(['tag']).count().reset_index().values[:,:2].tolist()\n",
    "wordcloud_data = wordcloud_NH_data+wordcloud_SHH_data\n",
    "wordcloud_data = [{'name':i[0],'value':i[1]}for i in wordcloud_data]\n",
    "wordcloud_data"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-20T08:21:27.347916100Z",
     "start_time": "2023-11-20T08:21:27.322057Z"
    }
   },
   "id": "ddf5f1d29a4853d0"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
